followup SM fix, discard support (kde#341930)

- note qt5-qtmultimedia dep is runtime-only
epel9
Rex Dieter 10 years ago
parent dfd111d3e5
commit 2f872580d2

@ -0,0 +1,49 @@
On branch topic-session-save
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: sm.cpp
diff --git a/sm.cpp b/sm.cpp
index 2098b7f..05a5d77 100644
--- a/sm.cpp
+++ b/sm.cpp
@@ -30,6 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "workspace.h"
#include "client.h"
#include <QDebug>
+#include <QFile>
#include <QSocketNotifier>
#include <QSessionManager>
@@ -64,18 +65,30 @@ void Workspace::saveState(QSessionManager &sm)
// too late, as possible user interaction may change some things.
// Phase2 is still needed though (ICCCM 5.2)
KConfig *config = sessionConfig(sm.sessionId(), sm.sessionKey());
+
if (!sm.isPhase2()) {
KConfigGroup cg(config, "Session");
cg.writeEntry("AllowsInteraction", sm.allowsInteraction());
sessionSaveStarted();
if (gs_sessionManagerIsKSMServer) // save stacking order etc. before "save file?" etc. dialogs change it
storeSession(config, SMSavePhase0);
+ // don't save it to disk
+ config->markAsClean();
sm.release(); // Qt doesn't automatically release in this case (bug?)
sm.requestPhase2();
return;
}
storeSession(config, gs_sessionManagerIsKSMServer ? SMSavePhase2 : SMSavePhase2Full);
config->sync();
+
+ // generate discard command for new file
+ QString localFilePath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + config->name();
+ if (QFile::exists(localFilePath)) {
+ QStringList discard;
+ discard << QLatin1String("rm");
+ discard << localFilePath;
+ sm.setDiscardCommand(discard);
+ }
}
// I bet this is broken, just like everywhere else in KDE

@ -7,7 +7,7 @@
Name: kwin
Version: 5.3.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: KDE Window manager
# all sources are effectively GPLv2+, except for:
@ -27,6 +27,8 @@ Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{name}-%{ve
## upstreamable patches
# session management, https://git.reviewboard.kde.org/r/123580/
Patch1: kwin-session_management_review123580.patch
# followup to add discard support
Patch2: kwin-sm_discard.patch
# Base
BuildRequires: kf5-rpm-macros
@ -38,7 +40,6 @@ BuildRequires: qt5-qtscript-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qttools-static
BuildRequires: qt5-qtx11extras-devel
BuildRequires: qt5-qtmultimedia-devel
# X11/OpenGL
BuildRequires: mesa-libGL-devel
@ -89,8 +90,9 @@ BuildRequires: kf5-kdeclarative-devel
BuildRequires: kdecoration-devel
# Runtime deps
## Runtime deps
Requires: kf5-filesystem
# Runtime-only dependency for effect video playback
Requires: qt5-qtmultimedia
# Before kwin was split out from kde-workspace into a subpackage
@ -229,6 +231,10 @@ fi
%changelog
* Sun May 17 2015 Rex Dieter <rdieter@fedoraproject.org> - 5.3.0-4
- followup SM fix, discard support (kde#341930)
- note qt5-qtmultimedia dep is runtime-only
* Thu May 14 2015 Rex Dieter <rdieter@fedoraproject.org> - 5.3.0-3
- test candidate SM fixes (reviewboard#123580,kde#341930)
- move libkdeinit bits out of -libs

Loading…
Cancel
Save