Skip to content

Commit

Permalink
Fixed #418 - Windows State/Size does not save in case of fullscreen (3)
Browse files Browse the repository at this point in the history
Need to apply only for QT under 6.3. Otherwise, other QT issue is present.
  • Loading branch information
foldynl committed Jul 23, 2024
1 parent 75c4f70 commit ff9449a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,22 +572,28 @@ void MainWindow::setLayoutGeometry()
|| layoutProfile.mainState != QByteArray() )
{
restoreGeometry(layoutProfile.mainGeometry);
#if (QT_VERSION < QT_VERSION_CHECK(6, 3, 0))
// workaround for QTBUG-46620
if ( isMaximized() )
{
const QList<QScreen *> &screens = QGuiApplication::screens();
setGeometry( screens[0]->availableGeometry() );
}
#endif
restoreState(layoutProfile.mainState);
darkLightModeSwith->setChecked(layoutProfile.darkMode);
}
else
{
restoreGeometry(settings.value("geometry").toByteArray());
#if (QT_VERSION < QT_VERSION_CHECK(6, 3, 0))
// workaround for QTBUG-46620
if ( isMaximized() )
{
const QList<QScreen *> &screens = QGuiApplication::screens();
setGeometry( screens[0]->availableGeometry() );
}
#endif
restoreState(settings.value("windowState").toByteArray());
// leave dark mode as is
}
Expand Down Expand Up @@ -705,11 +711,14 @@ void MainWindow::setupLayoutMenu()
|| layoutProfile.mainState != QByteArray() )
{
restoreGeometry(layoutProfile.mainGeometry);
#if (QT_VERSION < QT_VERSION_CHECK(6, 3, 0))
// workaround for QTBUG-46620
if ( isMaximized() )
{
const QList<QScreen *> &screens = QGuiApplication::screens();
setGeometry( screens[0]->availableGeometry() );
}
#endif
restoreState(layoutProfile.mainState);
darkLightModeSwith->setChecked(isFusionStyle && layoutProfile.darkMode);
}
Expand Down

0 comments on commit ff9449a

Please sign in to comment.