Skip to content

Commit

Permalink
Merge pull request #481 from KrisVos130/fix_hyprland_window_open_bug
Browse files Browse the repository at this point in the history
Fix window restoring on opening with Hyprland
  • Loading branch information
iwalton3 authored Aug 27, 2023
2 parents 477ddc5 + a4b6ce0 commit 5391553
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/ui/KonvergoWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,12 @@ void KonvergoWindow::saveGeometry()

qDebug() << "Saving window geometry:" << rc;

if (visibility() == QWindow::Maximized)
{
SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "maximized", true);
}
else if (visibility() != QWindow::Hidden)
if (visibility() != QWindow::Hidden)
{
QVariantMap map = {{"x", rc.x()}, {"y", rc.y()},
{"width", rc.width()}, {"height", rc.height()}};
SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "geometry", map);
SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "maximized", false);
SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "maximized", visibility() == QWindow::Maximized);
}
QScreen *curScreen = screen();
SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "lastUsedScreen", curScreen ? curScreen->name() : "");
Expand Down Expand Up @@ -226,9 +222,6 @@ QRect KonvergoWindow::loadGeometry()
}
else
{
if (myScreen)
nsize = myScreen->geometry();

setGeometry(nsize);
if (SettingsComponent::Get().value(SETTINGS_SECTION_STATE, "maximized").toBool())
setVisibility(QWindow::Maximized);
Expand Down

0 comments on commit 5391553

Please sign in to comment.