rdieter pushed to kwin (f22). "followup SM fix, discard support (kde#341930) (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Sun May 17 13:27:04 UTC 2015


From 2f872580d2b4bb75e20ebe46f8bb5c596f17511b Mon Sep 17 00:00:00 2001
From: Rex Dieter <rdieter at math.unl.edu>
Date: Sun, 17 May 2015 08:26:25 -0500
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 <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
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 <rdieter at 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 at fedoraproject.org> - 5.3.0-3
 - test candidate SM fixes (reviewboard#123580,kde#341930)
 - move libkdeinit bits out of -libs
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/kwin.git/commit/?h=f22&id=2f872580d2b4bb75e20ebe46f8bb5c596f17511b


More information about the scm-commits mailing list