1 |
commit: fabb3f9f1de7d866981f7be223b254f4040f7015 |
2 |
Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Jun 26 20:09:20 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 26 20:36:30 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fabb3f9f |
7 |
|
8 |
kde-plasma/kwin: Add back saving/loading/client matching by WM_COMMAND |
9 |
|
10 |
Upstream dropped it in 5.6 but later found out it was still in use by |
11 |
Mozilla applications et al., thus reverted in Plasma/5.6 branch but |
12 |
only after 5.6.5 release. |
13 |
|
14 |
Package-Manager: portage-2.2.28 |
15 |
|
16 |
.../files/kwin-5.6.5-legacy-session-mgmt.patch | 140 +++++++++++++++++++++ |
17 |
kde-plasma/kwin/kwin-5.6.5-r1.ebuild | 99 +++++++++++++++ |
18 |
2 files changed, 239 insertions(+) |
19 |
|
20 |
diff --git a/kde-plasma/kwin/files/kwin-5.6.5-legacy-session-mgmt.patch b/kde-plasma/kwin/files/kwin-5.6.5-legacy-session-mgmt.patch |
21 |
new file mode 100644 |
22 |
index 0000000..067124a |
23 |
--- /dev/null |
24 |
+++ b/kde-plasma/kwin/files/kwin-5.6.5-legacy-session-mgmt.patch |
25 |
@@ -0,0 +1,140 @@ |
26 |
+commit 59740e7416bb2b3a9852212fa4b213e5ba76deb7 |
27 |
+Author: Andreas Hartmetz <ahartmetz@×××××.com> |
28 |
+Date: Thu Jun 23 19:40:40 2016 +0200 |
29 |
+ |
30 |
+ Revert "Remove saving and loading (and client matching by) WM_COMMAND." |
31 |
+ |
32 |
+ This reverts commit 2eac7634cc524bf5e425cf081a639a6b6407e380. |
33 |
+ |
34 |
+ CCBUG: 362671 |
35 |
+ |
36 |
+diff --git a/activities.cpp b/activities.cpp |
37 |
+index 25eb1c1..42c5db8 100644 |
38 |
+--- a/activities.cpp |
39 |
++++ b/activities.cpp |
40 |
+@@ -169,7 +169,7 @@ void Activities::reallyStop(const QString &id) |
41 |
+ const Client* c = (*it); |
42 |
+ const QByteArray sessionId = c->sessionId(); |
43 |
+ if (sessionId.isEmpty()) { |
44 |
+- continue; |
45 |
++ continue; //TODO support old wm_command apps too? |
46 |
+ } |
47 |
+ |
48 |
+ //qDebug() << sessionId; |
49 |
+diff --git a/sm.cpp b/sm.cpp |
50 |
+index 08810a4..ca1edea 100644 |
51 |
+--- a/sm.cpp |
52 |
++++ b/sm.cpp |
53 |
+@@ -109,8 +109,12 @@ void Workspace::storeSession(KConfig* config, SMSavePhase phase) |
54 |
+ for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) { |
55 |
+ Client* c = (*it); |
56 |
+ QByteArray sessionId = c->sessionId(); |
57 |
++ QByteArray wmCommand = c->wmCommand(); |
58 |
+ if (sessionId.isEmpty()) |
59 |
+- continue; |
60 |
++ // remember also applications that are not XSMP capable |
61 |
++ // and use the obsolete WM_COMMAND / WM_SAVE_YOURSELF |
62 |
++ if (wmCommand.isEmpty()) |
63 |
++ continue; |
64 |
+ count++; |
65 |
+ if (c->isActive()) |
66 |
+ active_client = count; |
67 |
+@@ -140,6 +144,7 @@ void Workspace::storeClient(KConfigGroup &cg, int num, Client *c) |
68 |
+ QString n = QString::number(num); |
69 |
+ cg.writeEntry(QLatin1String("sessionId") + n, c->sessionId().constData()); |
70 |
+ cg.writeEntry(QLatin1String("windowRole") + n, c->windowRole().constData()); |
71 |
++ cg.writeEntry(QLatin1String("wmCommand") + n, c->wmCommand().constData()); |
72 |
+ cg.writeEntry(QLatin1String("resourceName") + n, c->resourceName().constData()); |
73 |
+ cg.writeEntry(QLatin1String("resourceClass") + n, c->resourceClass().constData()); |
74 |
+ cg.writeEntry(QLatin1String("geometry") + n, QRect(c->calculateGravitation(true), c->clientSize())); // FRAME |
75 |
+@@ -180,8 +185,12 @@ void Workspace::storeSubSession(const QString &name, QSet<QByteArray> sessionIds |
76 |
+ for (ClientList::Iterator it = clients.begin(); it != clients.end(); ++it) { |
77 |
+ Client* c = (*it); |
78 |
+ QByteArray sessionId = c->sessionId(); |
79 |
++ QByteArray wmCommand = c->wmCommand(); |
80 |
+ if (sessionId.isEmpty()) |
81 |
+- continue; |
82 |
++ // remember also applications that are not XSMP capable |
83 |
++ // and use the obsolete WM_COMMAND / WM_SAVE_YOURSELF |
84 |
++ if (wmCommand.isEmpty()) |
85 |
++ continue; |
86 |
+ if (!sessionIds.contains(sessionId)) |
87 |
+ continue; |
88 |
+ |
89 |
+@@ -221,6 +230,7 @@ void Workspace::addSessionInfo(KConfigGroup &cg) |
90 |
+ session.append(info); |
91 |
+ info->sessionId = cg.readEntry(QLatin1String("sessionId") + n, QString()).toLatin1(); |
92 |
+ info->windowRole = cg.readEntry(QLatin1String("windowRole") + n, QString()).toLatin1(); |
93 |
++ info->wmCommand = cg.readEntry(QLatin1String("wmCommand") + n, QString()).toLatin1(); |
94 |
+ info->resourceName = cg.readEntry(QLatin1String("resourceName") + n, QString()).toLatin1(); |
95 |
+ info->resourceClass = cg.readEntry(QLatin1String("resourceClass") + n, QString()).toLower().toLatin1(); |
96 |
+ info->geometry = cg.readEntry(QLatin1String("geometry") + n, QRect()); |
97 |
+@@ -269,6 +279,7 @@ SessionInfo* Workspace::takeSessionInfo(Client* c) |
98 |
+ SessionInfo *realInfo = 0; |
99 |
+ QByteArray sessionId = c->sessionId(); |
100 |
+ QByteArray windowRole = c->windowRole(); |
101 |
++ QByteArray wmCommand = c->wmCommand(); |
102 |
+ QByteArray resourceName = c->resourceName(); |
103 |
+ QByteArray resourceClass = c->resourceClass(); |
104 |
+ |
105 |
+@@ -302,8 +313,10 @@ SessionInfo* Workspace::takeSessionInfo(Client* c) |
106 |
+ if (info->resourceName == resourceName |
107 |
+ && info->resourceClass == resourceClass |
108 |
+ && sessionInfoWindowTypeMatch(c, info)) { |
109 |
+- realInfo = info; |
110 |
+- session.removeAll(info); |
111 |
++ if (wmCommand.isEmpty() || info->wmCommand == wmCommand) { |
112 |
++ realInfo = info; |
113 |
++ session.removeAll(info); |
114 |
++ } |
115 |
+ } |
116 |
+ } |
117 |
+ } |
118 |
+diff --git a/sm.h b/sm.h |
119 |
+index 4c5fda6..529187d 100644 |
120 |
+--- a/sm.h |
121 |
++++ b/sm.h |
122 |
+@@ -41,6 +41,7 @@ class Client; |
123 |
+ struct SessionInfo { |
124 |
+ QByteArray sessionId; |
125 |
+ QByteArray windowRole; |
126 |
++ QByteArray wmCommand; |
127 |
+ QByteArray wmClientMachine; |
128 |
+ QByteArray resourceName; |
129 |
+ QByteArray resourceClass; |
130 |
+diff --git a/toplevel.cpp b/toplevel.cpp |
131 |
+index af368b5..4a7ec6d 100644 |
132 |
+--- a/toplevel.cpp |
133 |
++++ b/toplevel.cpp |
134 |
+@@ -177,6 +177,19 @@ QByteArray Toplevel::sessionId() const |
135 |
+ return result; |
136 |
+ } |
137 |
+ |
138 |
++/*! |
139 |
++ Returns command property for this client, |
140 |
++ taken either from its window or from the leader window. |
141 |
++ */ |
142 |
++QByteArray Toplevel::wmCommand() |
143 |
++{ |
144 |
++ QByteArray result = Xcb::StringProperty(window(), XCB_ATOM_WM_COMMAND); |
145 |
++ if (result.isEmpty() && wmClientLeaderWin && wmClientLeaderWin != window()) |
146 |
++ result = Xcb::StringProperty(wmClientLeaderWin, XCB_ATOM_WM_COMMAND); |
147 |
++ result.replace(0, ' '); |
148 |
++ return result; |
149 |
++} |
150 |
++ |
151 |
+ void Toplevel::getWmClientMachine() |
152 |
+ { |
153 |
+ m_clientMachine->resolve(window(), wmClientLeader()); |
154 |
+diff --git a/toplevel.h b/toplevel.h |
155 |
+index 3133851..91eee5f 100644 |
156 |
+--- a/toplevel.h |
157 |
++++ b/toplevel.h |
158 |
+@@ -274,6 +274,7 @@ public: |
159 |
+ QByteArray sessionId() const; |
160 |
+ QByteArray resourceName() const; |
161 |
+ QByteArray resourceClass() const; |
162 |
++ QByteArray wmCommand(); |
163 |
+ QByteArray wmClientMachine(bool use_localhost) const; |
164 |
+ const ClientMachine *clientMachine() const; |
165 |
+ Window wmClientLeader() const; |
166 |
|
167 |
diff --git a/kde-plasma/kwin/kwin-5.6.5-r1.ebuild b/kde-plasma/kwin/kwin-5.6.5-r1.ebuild |
168 |
new file mode 100644 |
169 |
index 0000000..2f12148 |
170 |
--- /dev/null |
171 |
+++ b/kde-plasma/kwin/kwin-5.6.5-r1.ebuild |
172 |
@@ -0,0 +1,99 @@ |
173 |
+# Copyright 1999-2016 Gentoo Foundation |
174 |
+# Distributed under the terms of the GNU General Public License v2 |
175 |
+# $Id$ |
176 |
+ |
177 |
+EAPI=6 |
178 |
+ |
179 |
+KDE_HANDBOOK="optional" |
180 |
+KDE_TEST="optional" |
181 |
+VIRTUALX_REQUIRED="test" |
182 |
+inherit kde5 |
183 |
+ |
184 |
+DESCRIPTION="KDE window manager" |
185 |
+LICENSE="GPL-2+" |
186 |
+KEYWORDS="~amd64 ~arm ~x86" |
187 |
+IUSE="gles2 multimedia" |
188 |
+ |
189 |
+# drop qtcore subslot operator when QT_MINIMAL >= 5.7.0 |
190 |
+COMMON_DEPEND=" |
191 |
+ $(add_frameworks_dep kactivities) |
192 |
+ $(add_frameworks_dep kauth) |
193 |
+ $(add_frameworks_dep kcmutils) |
194 |
+ $(add_frameworks_dep kcompletion) |
195 |
+ $(add_frameworks_dep kconfig) |
196 |
+ $(add_frameworks_dep kconfigwidgets) |
197 |
+ $(add_frameworks_dep kcoreaddons) |
198 |
+ $(add_frameworks_dep kcrash) |
199 |
+ $(add_frameworks_dep kdeclarative) |
200 |
+ $(add_frameworks_dep kglobalaccel) |
201 |
+ $(add_frameworks_dep ki18n) |
202 |
+ $(add_frameworks_dep kiconthemes) |
203 |
+ $(add_frameworks_dep kidletime) |
204 |
+ $(add_frameworks_dep kinit) |
205 |
+ $(add_frameworks_dep kio) |
206 |
+ $(add_frameworks_dep knewstuff) |
207 |
+ $(add_frameworks_dep knotifications) |
208 |
+ $(add_frameworks_dep kpackage) |
209 |
+ $(add_frameworks_dep kservice) |
210 |
+ $(add_frameworks_dep kwayland) |
211 |
+ $(add_frameworks_dep kwidgetsaddons) |
212 |
+ $(add_frameworks_dep kwindowsystem X) |
213 |
+ $(add_frameworks_dep kxmlgui) |
214 |
+ $(add_frameworks_dep plasma) |
215 |
+ $(add_plasma_dep kdecoration) |
216 |
+ $(add_plasma_dep kscreenlocker) |
217 |
+ $(add_qt_dep qtcore '' '' '5=') |
218 |
+ $(add_qt_dep qtdbus) |
219 |
+ $(add_qt_dep qtdeclarative) |
220 |
+ $(add_qt_dep qtgui 'gles2=,opengl(+)') |
221 |
+ $(add_qt_dep qtscript) |
222 |
+ $(add_qt_dep qtwidgets) |
223 |
+ $(add_qt_dep qtx11extras) |
224 |
+ >=dev-libs/libinput-0.10 |
225 |
+ >=dev-libs/wayland-1.2 |
226 |
+ media-libs/fontconfig |
227 |
+ media-libs/freetype |
228 |
+ media-libs/libepoxy |
229 |
+ media-libs/mesa[egl,gbm,gles2?,wayland] |
230 |
+ virtual/libudev:= |
231 |
+ x11-libs/libICE |
232 |
+ x11-libs/libSM |
233 |
+ x11-libs/libX11 |
234 |
+ x11-libs/libXi |
235 |
+ x11-libs/libdrm |
236 |
+ >=x11-libs/libxcb-1.10 |
237 |
+ >=x11-libs/libxkbcommon-0.4.1 |
238 |
+ x11-libs/xcb-util-cursor |
239 |
+ x11-libs/xcb-util-image |
240 |
+ x11-libs/xcb-util-keysyms |
241 |
+" |
242 |
+RDEPEND="${COMMON_DEPEND} |
243 |
+ $(add_plasma_dep kde-cli-tools) |
244 |
+ multimedia? ( |
245 |
+ || ( |
246 |
+ $(add_qt_dep qtmultimedia 'gstreamer,qml') |
247 |
+ $(add_qt_dep qtmultimedia 'gstreamer010,qml') |
248 |
+ ) |
249 |
+ ) |
250 |
+ !<kde-apps/kdeartwork-meta-15.08.3-r1:4 |
251 |
+ !kde-base/kwin:4 |
252 |
+ !kde-base/systemsettings:4 |
253 |
+" |
254 |
+DEPEND="${COMMON_DEPEND} |
255 |
+ $(add_qt_dep designer) |
256 |
+ $(add_qt_dep qtconcurrent) |
257 |
+ x11-proto/xproto |
258 |
+ test? ( x11-libs/xcb-util-wm ) |
259 |
+" |
260 |
+ |
261 |
+RESTRICT="test" |
262 |
+ |
263 |
+PATCHES=( |
264 |
+ "${FILESDIR}/${PN}-5.6.3-glibc-sysmacros.patch" |
265 |
+ "${FILESDIR}/${PN}-5.6.5-legacy-session-mgmt.patch" # backport in 5.6 after release |
266 |
+) |
267 |
+ |
268 |
+src_prepare() { |
269 |
+ kde5_src_prepare |
270 |
+ use multimedia || eapply "${FILESDIR}/${PN}-gstreamer-optional.patch" |
271 |
+} |