diff --git a/ui/MainWindow.cpp b/ui/MainWindow.cpp index cc65c5ed..7e172b70 100644 --- a/ui/MainWindow.cpp +++ b/ui/MainWindow.cpp @@ -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 &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 &screens = QGuiApplication::screens(); setGeometry( screens[0]->availableGeometry() ); } +#endif restoreState(settings.value("windowState").toByteArray()); // leave dark mode as is } @@ -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 &screens = QGuiApplication::screens(); setGeometry( screens[0]->availableGeometry() ); } +#endif restoreState(layoutProfile.mainState); darkLightModeSwith->setChecked(isFusionStyle && layoutProfile.darkMode); }