[kde-doc-english] [trojita] src/Gui: GUI: fix the maximized state when restoring geometry

Jan Kundrát jkt at flaska.net
Thu Aug 22 10:45:17 UTC 2013


Git commit 0cc76e77f5b2b5bd0c4947ae29ebbf9d5b74aa41 by Jan Kundrát.
Committed on 21/08/2013 at 05:10.
Pushed by jkt into branch 'master'.

GUI: fix the maximized state when restoring geometry

This is a workaround for https://bugreports.qt-project.org/browse/QTBUG-30636.

Thanks to Thomas for comments.

BUG: 323715
REVIEW: 112182

M  +9    -0    src/Gui/Window.cpp

http://commits.kde.org/trojita/0cc76e77f5b2b5bd0c4947ae29ebbf9d5b74aa41

diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index 1582438..b0609c6 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -2328,6 +2328,15 @@ void MainWindow::applySizesAndState()
     if (size-- && !stream.atEnd()) {
         stream >> item;
         restoreGeometry(item);
+
+        // Workaround for https://bugreports.qt-project.org/browse/QTBUG-30636
+        // The call to setGeometry() causes a mismatch between the widget's geometry() and the actual size when the widget was
+        // originally maximized and is also maximized after the restore.
+        // The interesting thing is that simply flipping the Qt::WindowMaximized WS bit does not help.
+        if (windowState() & Qt::WindowMaximized) {
+            showNormal();
+            showMaximized();
+        }
     }
 
     if (size-- && !stream.atEnd()) {


More information about the kde-doc-english mailing list