forked from pool/kdelibs4support
This commit is contained in:
parent
8fc2cc1ffe
commit
aa685deb36
112
fix-session-saving.patch
Normal file
112
fix-session-saving.patch
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
diff --git a/src/kdeui/kapplication.cpp b/src/kdeui/kapplication.cpp
|
||||||
|
index 6ffaf6e..dc73b12 100644
|
||||||
|
--- a/src/kdeui/kapplication.cpp
|
||||||
|
+++ b/src/kdeui/kapplication.cpp
|
||||||
|
@@ -472,6 +472,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
|
||||||
|
@@ -550,6 +556,8 @@ void KApplication::commitData(QSessionManager &sm)
|
||||||
|
d->session_save = true;
|
||||||
|
bool canceled = false;
|
||||||
|
|
||||||
|
+ sm.setAutoCloseWindowsEnabled(false);
|
||||||
|
+
|
||||||
|
foreach (KSessionManager *it, KSessionManager::sessionClients()) {
|
||||||
|
if ((canceled = !it->commitData(sm))) {
|
||||||
|
break;
|
||||||
|
@@ -577,11 +585,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 +607,10 @@ void KApplication::commitData(QSessionManager &sm)
|
||||||
|
} else {
|
||||||
|
sm.setRestartHint(QSessionManager::RestartIfRunning);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (canceled) {
|
||||||
|
+ sm.cancel();
|
||||||
|
+ }
|
||||||
|
d->session_save = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -638,6 +652,7 @@ static void checkRestartVersion(QSessionManager &sm)
|
||||||
|
void KApplication::saveState(QSessionManager &sm)
|
||||||
|
{
|
||||||
|
d->session_save = true;
|
||||||
|
+ sm.setAutoCloseWindowsEnabled(false);
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#warning TODO: QSessionManager::handle() is gone in Qt5!
|
||||||
|
#endif
|
||||||
|
@@ -988,4 +1003,3 @@ void KApplicationPrivate::_k_slot_KToolInvocation_hook(QStringList &envs, QByteA
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "moc_kapplication.cpp"
|
||||||
|
-
|
||||||
|
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();
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 17 22:07:24 UTC 2016 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
- Added fix-session-saving.patch (kde#354724, boo#955280)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Feb 6 18:00:48 UTC 2016 - hrvoje.senjan@gmail.com
|
Sat Feb 6 18:00:48 UTC 2016 - hrvoje.senjan@gmail.com
|
||||||
|
|
||||||
|
@ -76,6 +76,8 @@ Group: System/GUI/KDE
|
|||||||
Url: http://www.kde.org
|
Url: http://www.kde.org
|
||||||
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/portingAids/%{name}-%{version}.tar.xz
|
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/portingAids/%{name}-%{version}.tar.xz
|
||||||
Source1: baselibs.conf
|
Source1: baselibs.conf
|
||||||
|
# PATCH-FIX-UPSTREAM fix-session-saving.patch -- kde#354724, boo#955280
|
||||||
|
Patch0: fix-session-saving.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -188,6 +190,7 @@ KDEDIRS environment variable correctly. Development files.
|
|||||||
%lang_package
|
%lang_package
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake_kf5 -d build
|
%cmake_kf5 -d build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user