From 2f872580d2b4bb75e20ebe46f8bb5c596f17511b Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: May 17 2015 13:26:25 +0000 Subject: followup SM fix, discard support (kde#341930) - note qt5-qtmultimedia dep is runtime-only --- diff --git a/kwin-sm_discard.patch b/kwin-sm_discard.patch new file mode 100644 index 0000000..18d1ad8 --- /dev/null +++ b/kwin-sm_discard.patch @@ -0,0 +1,49 @@ +On branch topic-session-save +Changes to be committed: + (use "git reset HEAD ..." 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 . + #include "workspace.h" + #include "client.h" + #include ++#include + #include + #include + +@@ -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 diff --git a/kwin.spec b/kwin.spec index 7b488fd..3fc654e 100644 --- a/kwin.spec +++ b/kwin.spec @@ -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 - 5.3.0-4 +- followup SM fix, discard support (kde#341930) +- note qt5-qtmultimedia dep is runtime-only + * Thu May 14 2015 Rex Dieter - 5.3.0-3 - test candidate SM fixes (reviewboard#123580,kde#341930) - move libkdeinit bits out of -libs