From 95f4d8ae9ad7e427d0c0495750a40425aabbf0e7656b3c8a34950419d0a69ea5 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sun, 6 Mar 2016 10:01:26 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kdelibs4support?expand=0&rev=90 --- fix-session-saving.patch | 123 ------------------ kdelibs4support.changes | 1 + ...sionManagementEnabled-API-with-5.5.1.patch | 2 +- 3 files changed, 2 insertions(+), 124 deletions(-) delete mode 100644 fix-session-saving.patch diff --git a/fix-session-saving.patch b/fix-session-saving.patch deleted file mode 100644 index b8d24e9..0000000 --- a/fix-session-saving.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 58e49487aece3de19aae90bbb9b80cd5aab94d04 Mon Sep 17 00:00:00 2001 -From: Andreas Hartmetz -Date: Fri, 19 Feb 2016 19:49:01 +0100 -Subject: [PATCH 2/2] Fix session management for KApplication based - applications. - -- Call QGuiApplication::setFallbackSessionManagementEnabled(false) - to prevent premature application exit -- Wire up the saveStateRequest() and commitDataRequest() signals - to the appropriate methods that had to be turned into slots first. - Those methods were never even called, they were not ported properly. -- Cancel logout when the user decides to do that. A comment in the - code was not sufficient to do that. (?!?!) - -CCBUG: 354724 ---- - src/kdeui/kapplication.cpp | 17 ++++++++++++++++- - src/kdeui/kapplication.h | 29 +++++++++++++++-------------- - 2 files changed, 31 insertions(+), 15 deletions(-) - -diff --git a/src/kdeui/kapplication.cpp b/src/kdeui/kapplication.cpp -index d78212a..54fd1de 100644 ---- a/src/kdeui/kapplication.cpp -+++ b/src/kdeui/kapplication.cpp -@@ -380,6 +380,9 @@ void KApplicationPrivate::init(bool GUIenabled) - parseCommandLine(); - - QApplication::setDesktopSettingsAware(false); -+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) -+ QGuiApplication::setFallbackSessionManagementEnabled(false); -+#endif - - #if HAVE_X11 - isX11 = (QGuiApplication::platformName() == QStringLiteral("xcb")); -@@ -472,6 +475,12 @@ void KApplicationPrivate::init(bool GUIenabled) - q->connect(KToolInvocation::self(), SIGNAL(kapplication_hook(QStringList&,QByteArray&)), - q, SLOT(_k_slot_KToolInvocation_hook(QStringList&,QByteArray&))); - -+ q->connect(q, SIGNAL(commitDataRequest(QSessionManager&)), -+ q, SLOT(commitData(QSessionManager&))); -+ q->connect(q, SIGNAL(saveStateRequest(QSessionManager&)), -+ q, SLOT(saveState(QSessionManager&))); -+ -+ - #ifdef Q_OS_MAC - // This is a QSystemTrayIcon instead of K* because we can't be sure q is a QWidget - QSystemTrayIcon *trayIcon; //krazy:exclude=qclasses -@@ -577,11 +586,13 @@ void KApplication::commitData(QSessionManager &sm) - continue; - } - -+ // leave KMainWindows alone because they are handled by KMWSessionManager - if (!w->isHidden() && !w->inherits("KMainWindow")) { - QCloseEvent e; - sendEvent(w, &e); - if (!e.isAccepted()) { -- break; //canceled -+ canceled = true; -+ break; - } - - donelist.append(w); -@@ -597,6 +608,10 @@ void KApplication::commitData(QSessionManager &sm) - } else { - sm.setRestartHint(QSessionManager::RestartIfRunning); - } -+ -+ if (canceled) { -+ sm.cancel(); -+ } - d->session_save = false; - } - -diff --git a/src/kdeui/kapplication.h b/src/kdeui/kapplication.h -index 2231084..c9b1cb6 100644 ---- a/src/kdeui/kapplication.h -+++ b/src/kdeui/kapplication.h -@@ -155,20 +155,6 @@ public: - void enableSessionManagement(); - - /** -- * Reimplemented for internal purposes, mainly the highlevel -- * handling of session management with KSessionManager. -- * @internal -- */ -- void commitData(QSessionManager &sm); -- -- /** -- * Reimplemented for internal purposes, mainly the highlevel -- * handling of session management with KSessionManager. -- * @internal -- */ -- void saveState(QSessionManager &sm); -- -- /** - * @deprecated since 5.0, use QGuiApplication::isSavingSession() - * - * Returns true if the application is currently saving its session -@@ -359,6 +345,21 @@ public Q_SLOTS: - */ - Q_SCRIPTABLE void updateUserTimestamp(int time = 0); - -+ /** -+ * Slot connected to QGuiApplication::commitDataRequest() to implement highlevel -+ * handling of session management with KSessionManager. -+ * @internal -+ */ -+ void commitData(QSessionManager &sm); -+ -+ /** -+ * Slot connected to QGuiApplication::saveStateRequest() to implement highlevel -+ * handling of session management with KSessionManager. -+ * @internal -+ */ -+ void saveState(QSessionManager &sm); -+ -+ - // D-Bus Q_SLOTS: - Q_SCRIPTABLE void reparseConfiguration(); - Q_SCRIPTABLE void quit(); --- -2.6.2 - diff --git a/kdelibs4support.changes b/kdelibs4support.changes index b2e4df6..84cbfaf 100644 --- a/kdelibs4support.changes +++ b/kdelibs4support.changes @@ -4,6 +4,7 @@ Sun Mar 6 09:56:08 UTC 2016 - hrvoje.senjan@gmail.com - Update to 5.20.0 * For more details please see: https://www.kde.org/announcements/kde-frameworks-5.20.0.php +- Drop upstreamed fix-session-saving.patch ------------------------------------------------------------------- Fri Feb 26 14:59:32 UTC 2016 - wbauer@tmo.at diff --git a/use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch b/use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch index 8eadb43..ec98626 100644 --- a/use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch +++ b/use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch @@ -5,7 +5,7 @@ index 54fd1de..631dc2b 100644 @@ -380,7 +380,7 @@ void KApplicationPrivate::init(bool GUIenabled) parseCommandLine(); - QApplication::setDesktopSettingsAware(false); + QGuiApplication::setDesktopSettingsAware(false); -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 1) QGuiApplication::setFallbackSessionManagementEnabled(false);