summaryrefslogtreecommitdiff
path: root/kde-frameworks/kxmlgui/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-09-30 17:27:54 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-09-30 17:27:54 +0100
commitf70a1bfc721336d4fc7dfb711c2f518a6b18cf16 (patch)
treee907cb121b30e3c1df1710719c0ddf4029597a47 /kde-frameworks/kxmlgui/files
parentdb063b515939ab15261136b24e4bc44386335c0c (diff)
gentoo resync : 30.09.2020
Diffstat (limited to 'kde-frameworks/kxmlgui/files')
-rw-r--r--kde-frameworks/kxmlgui/files/kxmlgui-5.74.0-fix-multiple-tabs-popup-on-logout.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/kde-frameworks/kxmlgui/files/kxmlgui-5.74.0-fix-multiple-tabs-popup-on-logout.patch b/kde-frameworks/kxmlgui/files/kxmlgui-5.74.0-fix-multiple-tabs-popup-on-logout.patch
new file mode 100644
index 000000000000..f49999eb6490
--- /dev/null
+++ b/kde-frameworks/kxmlgui/files/kxmlgui-5.74.0-fix-multiple-tabs-popup-on-logout.patch
@@ -0,0 +1,68 @@
+From 7cefdcf3d04669978aa28481d8ea274402935374 Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Date: Mon, 10 Aug 2020 09:54:14 +0200
+Subject: [PATCH] Handle double close in main window
+
+After a bug fix in Qt 5.14 we now get real close events for unclosed windows
+when the application closes, so we would be getting two close events breaking
+our logic when when to suppress on-close dialogs.
+
+Suppress the real close event after we have handled our own simulated one. Also
+works if there is no real close event.
+
+BUG: 416728
+
+* Fixup after git merged the wrong commit
+---
+ src/kmainwindow.cpp | 8 ++++++++
+ src/kmainwindow_p.h | 1 +
+ 2 files changed, 9 insertions(+)
+
+diff --git a/src/kmainwindow.cpp b/src/kmainwindow.cpp
+index b9bc2b6..33babb9 100644
+--- a/src/kmainwindow.cpp
++++ b/src/kmainwindow.cpp
+@@ -269,6 +269,7 @@ void KMainWindowPrivate::init(KMainWindow *_q)
+ letDirtySettings = true;
+
+ sizeApplied = false;
++ suppressCloseEvent = false;
+ }
+
+ static bool endsWithHashNumber(const QString &s)
+@@ -532,6 +533,10 @@ void KMainWindow::appHelpActivated()
+ void KMainWindow::closeEvent(QCloseEvent *e)
+ {
+ K_D(KMainWindow);
++ if (d->suppressCloseEvent) {
++ e->accept();
++ return;
++ }
+
+ // Save settings if auto-save is enabled, and settings have changed
+ if (d->settingsTimer && d->settingsTimer->isActive()) {
+@@ -556,6 +561,9 @@ void KMainWindow::closeEvent(QCloseEvent *e)
+ } else {
+ e->ignore(); //if the window should not be closed, don't close it
+ }
++ // If saving session, we are processing a fake close event, and might get the real one later.
++ if (e->isAccepted() && qApp->isSavingSession())
++ d->suppressCloseEvent = true;
+ }
+
+ bool KMainWindow::queryClose()
+diff --git a/src/kmainwindow_p.h b/src/kmainwindow_p.h
+index 13f6f19..bdd1eb4 100644
+--- a/src/kmainwindow_p.h
++++ b/src/kmainwindow_p.h
+@@ -33,6 +33,7 @@ public:
+ bool settingsDirty: 1;
+ bool autoSaveWindowSize: 1;
+ bool sizeApplied: 1;
++ bool suppressCloseEvent: 1;
+ KConfigGroup autoSaveGroup;
+ QTimer *settingsTimer;
+ QTimer *sizeTimer;
+--
+2.28.0
+