summaryrefslogtreecommitdiff
path: root/kde-frameworks/kxmlgui/files/kxmlgui-5.48.0-kmainwindow.patch
blob: ffc62a676d555e5c9048c0e4791ca6e678fd7b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From d35a88289513c0420863b80aa6c1cb7d2c6e978f Mon Sep 17 00:00:00 2001
From: Mladen Milinkovic <max@scarlettvisionmedia.com>
Date: Tue, 17 Jul 2018 09:45:30 +0200
Subject: Fix KMainWindow saving incorrect widget settings

BUG: 395988
In certain cases KMainWindow::saveMainWindowSettings() could have been
called after mainwindow started destroying itself. Window settings would
be saved with incorrect child widget states. e.g. some widgets would be
saved as hidden even if they were visible before destroying.
---
 src/kmainwindow.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/kmainwindow.cpp b/src/kmainwindow.cpp
index 810bf32..885ac60 100644
--- a/src/kmainwindow.cpp
+++ b/src/kmainwindow.cpp
@@ -524,6 +524,10 @@ void KMainWindow::closeEvent(QCloseEvent *e)
     }
 
     if (queryClose()) {
+        // widgets will start destroying themselves at this point and we don't
+        // want to save state anymore after this as it might be incorrect
+        d->autoSaveSettings = false;
+        d->letDirtySettings = false;
         e->accept();
     } else {
         e->ignore();    //if the window should not be closed, don't close it
-- 
cgit v0.11.2