summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-09-29 00:11:17 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-09-29 14:45:28 +0200
commit42f0c2565da241c89fbf0e7276718ebe41517400 (patch)
tree105c8ecfb58ca494c645cb0dde7d67161ad4b461 /kde-frameworks/kxmlgui
parentkde-frameworks/kdeclarative: Drop 5.74.0 (r0) (diff)
downloadgentoo-42f0c2565da241c89fbf0e7276718ebe41517400.tar.gz
gentoo-42f0c2565da241c89fbf0e7276718ebe41517400.tar.bz2
gentoo-42f0c2565da241c89fbf0e7276718ebe41517400.zip
kde-frameworks/kxmlgui: Fix "N open terminals/tabs" warning on logout
Upstream commits: 4bcf28f16938bfefacbe56ed53a4d3b3f00c4114 ab73c532cbcb16d9a3912670f021477dc25634fc KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=416728 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/kxmlgui')
-rw-r--r--kde-frameworks/kxmlgui/files/kxmlgui-5.74.0-fix-multiple-tabs-popup-on-logout.patch68
-rw-r--r--kde-frameworks/kxmlgui/kxmlgui-5.74.0-r1.ebuild55
2 files changed, 123 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
+
diff --git a/kde-frameworks/kxmlgui/kxmlgui-5.74.0-r1.ebuild b/kde-frameworks/kxmlgui/kxmlgui-5.74.0-r1.ebuild
new file mode 100644
index 000000000000..04c5486ff737
--- /dev/null
+++ b/kde-frameworks/kxmlgui/kxmlgui-5.74.0-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_DESIGNERPLUGIN="true"
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.14.2
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="Framework for managing menu and toolbar actions in an abstract way"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+LICENSE="LGPL-2+"
+IUSE=""
+
+# slot op: includes QtCore/private/qlocale_p.h
+DEPEND="
+ >=dev-qt/qtcore-${QTMIN}:5=
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtnetwork-${QTMIN}:5[ssl]
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ =kde-frameworks/kconfig-${PVCUT}*:5
+ =kde-frameworks/kconfigwidgets-${PVCUT}*:5
+ =kde-frameworks/kcoreaddons-${PVCUT}*:5
+ =kde-frameworks/kglobalaccel-${PVCUT}*:5
+ =kde-frameworks/ki18n-${PVCUT}*:5
+ =kde-frameworks/kiconthemes-${PVCUT}*:5
+ =kde-frameworks/kitemviews-${PVCUT}*:5
+ =kde-frameworks/kwidgetsaddons-${PVCUT}*:5
+ =kde-frameworks/kwindowsystem-${PVCUT}*:5
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}"/${P}-fix-multiple-tabs-popup-on-logout.patch )
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_KF5Attica=ON
+ )
+
+ ecm_src_configure
+}
+
+src_test() {
+ # Files are missing; whatever. Bugs 650290, 668198
+ local myctestargs=(
+ -E "(ktoolbar_unittest|kxmlgui_unittest)"
+ )
+
+ ecm_src_test
+}