Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kwin/files/, kde-plasma/kwin/
Date: Wed, 25 May 2022 21:13:19
Message-Id: 1653513011.854fdba3048965bfa65fdb9d0d827c3cf86283e7.asturm@gentoo
1 commit: 854fdba3048965bfa65fdb9d0d827c3cf86283e7
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 25 19:30:12 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Wed May 25 21:10:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=854fdba3
7
8 kde-plasma/kwin: Backport several 5.24.6 fixes
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 .../kwin-5.24.5-fix-plasmashell-crash-1.patch | 307 +++++++++++++++++++++
14 .../kwin-5.24.5-fix-plasmashell-crash-2.patch | 35 +++
15 .../kwin-5.24.5-update-device-outputName.patch | 32 +++
16 kde-plasma/kwin/kwin-5.24.5-r2.ebuild | 142 ++++++++++
17 4 files changed, 516 insertions(+)
18
19 diff --git a/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-1.patch b/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-1.patch
20 new file mode 100644
21 index 000000000000..46b6f0ad9c71
22 --- /dev/null
23 +++ b/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-1.patch
24 @@ -0,0 +1,307 @@
25 +From 4c3195270d6c8e1da8c3e2e3abe5aae75d5bf3c2 Mon Sep 17 00:00:00 2001
26 +From: Vlad Zahorodnii <vlad.zahorodnii@×××.org>
27 +Date: Fri, 26 Nov 2021 12:03:14 +0200
28 +Subject: [PATCH] Ensure that Toplevel::output() stays always in sync with
29 + geometry
30 +
31 +Currently, if geometry updates are blocked, the Toplevel.output property
32 +won't be updated. On the other hand, it's reasonable to use the output
33 +property instead of manually looking up the output in window management
34 +code, e.g. Workspace::clientArea().
35 +
36 +In other words, using the Toplevel.output property is like walking on a
37 +mine field, things can blow up. You can't use Toplevel.output even if it
38 +makes perfect sense.
39 +
40 +This change ensures that Toplevel.output property is always kept in sync
41 +with the frame geometry. Unfortunately, this means that the output
42 +property no longer can be updated when the frameGeometryChanged() signal
43 +is emitted. It has to be done in moveResizeInternal() method.
44 +
45 +BUG: 448064
46 +
47 +(cherry picked from 510a41eeb89f51843405fa0258c852ab06d05bb8)
48 +
49 +Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2448>
50 +---
51 + src/abstract_client.cpp | 3 ---
52 + src/events.cpp | 1 +
53 + src/internal_client.cpp | 6 ++++++
54 + src/toplevel.cpp | 17 -----------------
55 + src/toplevel.h | 10 ++--------
56 + src/unmanaged.cpp | 6 ++++++
57 + src/unmanaged.h | 1 +
58 + src/waylandclient.cpp | 6 ++++++
59 + src/x11client.cpp | 7 +++++++
60 + src/x11client.h | 1 +
61 + 10 files changed, 30 insertions(+), 28 deletions(-)
62 +
63 +diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp
64 +index 0714b9ac3f..ddff11e53c 100644
65 +--- a/src/abstract_client.cpp
66 ++++ b/src/abstract_client.cpp
67 +@@ -63,8 +63,6 @@ AbstractClient::AbstractClient()
68 + {
69 + connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::moveResizedChanged);
70 + connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged);
71 +- connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckOutputConnection);
72 +- connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::setupCheckOutputConnection);
73 +
74 + connect(this, &AbstractClient::windowShown, this, &AbstractClient::hiddenChanged);
75 + connect(this, &AbstractClient::windowHidden, this, &AbstractClient::hiddenChanged);
76 +@@ -1011,7 +1009,6 @@ void AbstractClient::finishInteractiveMoveResize(bool cancel)
77 + if (cancel) {
78 + moveResize(initialInteractiveMoveResizeGeometry());
79 + }
80 +- checkOutput(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment
81 + if (output() != interactiveMoveResizeStartOutput()) {
82 + workspace()->sendClientToOutput(this, output()); // checks rule validity
83 + if (isFullScreen() || maximizeMode() != MaximizeRestore) {
84 +diff --git a/src/events.cpp b/src/events.cpp
85 +index b9bb9bbd36..a22960f0d0 100644
86 +--- a/src/events.cpp
87 ++++ b/src/events.cpp
88 +@@ -1261,6 +1261,7 @@ void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e)
89 + m_clientGeometry = newgeom;
90 + m_frameGeometry = newgeom;
91 + m_bufferGeometry = newgeom;
92 ++ checkOutput();
93 + Q_EMIT bufferGeometryChanged(this, old);
94 + Q_EMIT clientGeometryChanged(this, old);
95 + Q_EMIT frameGeometryChanged(this, old);
96 +diff --git a/src/internal_client.cpp b/src/internal_client.cpp
97 +index 3be51ff27b..b4c9250fd3 100644
98 +--- a/src/internal_client.cpp
99 ++++ b/src/internal_client.cpp
100 +@@ -10,6 +10,7 @@
101 + #include "internal_client.h"
102 + #include "decorations/decorationbridge.h"
103 + #include "deleted.h"
104 ++#include "platform.h"
105 + #include "surfaceitem.h"
106 + #include "workspace.h"
107 +
108 +@@ -477,6 +478,7 @@ void InternalClient::commitGeometry(const QRect &rect)
109 + // The client geometry and the buffer geometry are the same.
110 + const QRect oldClientGeometry = m_clientGeometry;
111 + const QRect oldFrameGeometry = m_frameGeometry;
112 ++ const AbstractOutput *oldOutput = m_output;
113 +
114 + m_clientGeometry = frameRectToClientRect(rect);
115 + m_frameGeometry = rect;
116 +@@ -486,6 +488,7 @@ void InternalClient::commitGeometry(const QRect &rect)
117 + return;
118 + }
119 +
120 ++ m_output = kwinApp()->platform()->outputAt(rect.center());
121 + syncGeometryToInternalWindow();
122 +
123 + if (oldClientGeometry != m_clientGeometry) {
124 +@@ -495,6 +498,9 @@ void InternalClient::commitGeometry(const QRect &rect)
125 + if (oldFrameGeometry != m_frameGeometry) {
126 + Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
127 + }
128 ++ if (oldOutput != m_output) {
129 ++ Q_EMIT screenChanged();
130 ++ }
131 + Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
132 + }
133 +
134 +diff --git a/src/toplevel.cpp b/src/toplevel.cpp
135 +index 698f6998e5..ff216835c4 100644
136 +--- a/src/toplevel.cpp
137 ++++ b/src/toplevel.cpp
138 +@@ -47,7 +47,6 @@ Toplevel::Toplevel()
139 + , m_skipCloseAnimation(false)
140 + {
141 + connect(screens(), &Screens::changed, this, &Toplevel::screenChanged);
142 +- setupCheckOutputConnection();
143 + connect(this, &Toplevel::bufferGeometryChanged, this, &Toplevel::inputTransformationChanged);
144 +
145 + // Only for compatibility reasons, drop in the next major release.
146 +@@ -379,22 +378,6 @@ void Toplevel::deleteEffectWindow()
147 + effect_window = nullptr;
148 + }
149 +
150 +-void Toplevel::checkOutput()
151 +-{
152 +- setOutput(kwinApp()->platform()->outputAt(frameGeometry().center()));
153 +-}
154 +-
155 +-void Toplevel::setupCheckOutputConnection()
156 +-{
157 +- connect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::checkOutput);
158 +- checkOutput();
159 +-}
160 +-
161 +-void Toplevel::removeCheckOutputConnection()
162 +-{
163 +- disconnect(this, &Toplevel::frameGeometryChanged, this, &Toplevel::checkOutput);
164 +-}
165 +-
166 + int Toplevel::screen() const
167 + {
168 + return kwinApp()->platform()->enabledOutputs().indexOf(m_output);
169 +diff --git a/src/toplevel.h b/src/toplevel.h
170 +index f6b5dd4e61..3309647eb4 100644
171 +--- a/src/toplevel.h
172 ++++ b/src/toplevel.h
173 +@@ -636,13 +636,6 @@ Q_SIGNALS:
174 + void visibleGeometryChanged();
175 +
176 + protected Q_SLOTS:
177 +- /**
178 +- * Checks whether the screen number for this Toplevel changed and updates if needed.
179 +- * Any method changing the geometry of the Toplevel should call this method.
180 +- */
181 +- void checkOutput();
182 +- void setupCheckOutputConnection();
183 +- void removeCheckOutputConnection();
184 + void setReadyForPainting();
185 +
186 + protected:
187 +@@ -673,6 +666,8 @@ protected:
188 + void deleteShadow();
189 + void deleteEffectWindow();
190 + void setDepth(int depth);
191 ++
192 ++ AbstractOutput *m_output = nullptr;
193 + QRect m_frameGeometry;
194 + QRect m_clientGeometry;
195 + QRect m_bufferGeometry;
196 +@@ -700,7 +695,6 @@ private:
197 + QRegion opaque_region;
198 + mutable QRegion m_shapeRegion;
199 + mutable bool m_shapeRegionIsValid = false;
200 +- AbstractOutput *m_output = nullptr;
201 + bool m_skipCloseAnimation;
202 + quint32 m_pendingSurfaceId = 0;
203 + QPointer<KWaylandServer::SurfaceInterface> m_surface;
204 +diff --git a/src/unmanaged.cpp b/src/unmanaged.cpp
205 +index de3caa303d..3164813a75 100644
206 +--- a/src/unmanaged.cpp
207 ++++ b/src/unmanaged.cpp
208 +@@ -12,6 +12,7 @@
209 + #include "workspace.h"
210 + #include "effects.h"
211 + #include "deleted.h"
212 ++#include "platform.h"
213 + #include "surfaceitem_x11.h"
214 + #include "utils/common.h"
215 +
216 +@@ -206,6 +207,11 @@ QWindow *Unmanaged::findInternalWindow() const
217 + return nullptr;
218 + }
219 +
220 ++void Unmanaged::checkOutput()
221 ++{
222 ++ setOutput(kwinApp()->platform()->outputAt(frameGeometry().center()));
223 ++}
224 ++
225 + void Unmanaged::damageNotifyEvent()
226 + {
227 + Q_ASSERT(kwinApp()->operationMode() == Application::OperationModeX11);
228 +diff --git a/src/unmanaged.h b/src/unmanaged.h
229 +index e874fc1724..fa543eb0b8 100644
230 +--- a/src/unmanaged.h
231 ++++ b/src/unmanaged.h
232 +@@ -45,6 +45,7 @@ private:
233 + void configureNotifyEvent(xcb_configure_notify_event_t *e);
234 + void damageNotifyEvent();
235 + QWindow *findInternalWindow() const;
236 ++ void checkOutput();
237 + void associate();
238 + void initialize();
239 + bool m_outline = false;
240 +diff --git a/src/waylandclient.cpp b/src/waylandclient.cpp
241 +index 39d6ea22bc..9d8070c7f8 100644
242 +--- a/src/waylandclient.cpp
243 ++++ b/src/waylandclient.cpp
244 +@@ -7,6 +7,7 @@
245 + */
246 +
247 + #include "waylandclient.h"
248 ++#include "platform.h"
249 + #include "screens.h"
250 + #include "wayland_server.h"
251 + #include "workspace.h"
252 +@@ -289,6 +290,7 @@ void WaylandClient::updateGeometry(const QRect &rect)
253 + const QRect oldClientGeometry = m_clientGeometry;
254 + const QRect oldFrameGeometry = m_frameGeometry;
255 + const QRect oldBufferGeometry = m_bufferGeometry;
256 ++ const AbstractOutput *oldOutput = m_output;
257 +
258 + m_clientGeometry = frameRectToClientRect(rect);
259 + m_frameGeometry = rect;
260 +@@ -310,6 +312,7 @@ void WaylandClient::updateGeometry(const QRect &rect)
261 + return;
262 + }
263 +
264 ++ m_output = kwinApp()->platform()->outputAt(rect.center());
265 + updateWindowRules(Rules::Position | Rules::Size);
266 +
267 + if (changedGeometries & WaylandGeometryBuffer) {
268 +@@ -321,6 +324,9 @@ void WaylandClient::updateGeometry(const QRect &rect)
269 + if (changedGeometries & WaylandGeometryFrame) {
270 + Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
271 + }
272 ++ if (oldOutput != m_output) {
273 ++ Q_EMIT screenChanged();
274 ++ }
275 + Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
276 + }
277 +
278 +diff --git a/src/x11client.cpp b/src/x11client.cpp
279 +index ce275fff1b..d7ed823128 100644
280 +--- a/src/x11client.cpp
281 ++++ b/src/x11client.cpp
282 +@@ -4062,6 +4062,8 @@ void X11Client::moveResizeInternal(const QRect &rect, MoveResizeMode mode)
283 + m_lastClientGeometry == m_clientGeometry) {
284 + return;
285 + }
286 ++
287 ++ m_output = kwinApp()->platform()->outputAt(frameGeometry.center());
288 + if (areGeometryUpdatesBlocked()) {
289 + setPendingMoveResizeMode(mode);
290 + return;
291 +@@ -4070,6 +4072,7 @@ void X11Client::moveResizeInternal(const QRect &rect, MoveResizeMode mode)
292 + const QRect oldBufferGeometry = m_lastBufferGeometry;
293 + const QRect oldFrameGeometry = m_lastFrameGeometry;
294 + const QRect oldClientGeometry = m_lastClientGeometry;
295 ++ const AbstractOutput *oldOutput = m_lastOutput;
296 +
297 + updateServerGeometry();
298 + updateWindowRules(Rules::Position|Rules::Size);
299 +@@ -4077,6 +4080,7 @@ void X11Client::moveResizeInternal(const QRect &rect, MoveResizeMode mode)
300 + m_lastBufferGeometry = m_bufferGeometry;
301 + m_lastFrameGeometry = m_frameGeometry;
302 + m_lastClientGeometry = m_clientGeometry;
303 ++ m_lastOutput = m_output;
304 +
305 + if (isActive()) {
306 + workspace()->setActiveOutput(output());
307 +@@ -4092,6 +4096,9 @@ void X11Client::moveResizeInternal(const QRect &rect, MoveResizeMode mode)
308 + if (oldFrameGeometry != m_frameGeometry) {
309 + Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
310 + }
311 ++ if (oldOutput != m_output) {
312 ++ Q_EMIT screenChanged();
313 ++ }
314 + Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
315 + }
316 +
317 +diff --git a/src/x11client.h b/src/x11client.h
318 +index b523044d3d..adb8b0e8df 100644
319 +--- a/src/x11client.h
320 ++++ b/src/x11client.h
321 +@@ -524,6 +524,7 @@ private:
322 + QMetaObject::Connection m_edgeGeometryTrackingConnection;
323 +
324 + QMargins m_clientFrameExtents;
325 ++ AbstractOutput *m_lastOutput = nullptr;
326 + QRect m_lastBufferGeometry;
327 + QRect m_lastFrameGeometry;
328 + QRect m_lastClientGeometry;
329 +--
330 +GitLab
331 +
332
333 diff --git a/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-2.patch b/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-2.patch
334 new file mode 100644
335 index 000000000000..026efdf9465b
336 --- /dev/null
337 +++ b/kde-plasma/kwin/files/kwin-5.24.5-fix-plasmashell-crash-2.patch
338 @@ -0,0 +1,35 @@
339 +From a8477c1cf7acbf3358c85e53b236150dd43b4640 Mon Sep 17 00:00:00 2001
340 +From: Xaver Hugl <xaver.hugl@×××××.com>
341 +Date: Thu, 14 Apr 2022 18:48:56 +0200
342 +Subject: [PATCH] toplevel: set valid output in the constructor
343 +
344 +This makes it less easy to cause crashes and fixes some segfaults.
345 +
346 +BUG: 452433
347 +BUG: 448064
348 +
349 +(cherry picked from commit e48a5c0535f01dc380449ba8481c869ff23e5558)
350 +
351 +Tested-by: Merge Service <https://invent.kde.org/plasma/kwin/-/merge_requests/2448>
352 +Part-of: <https://invent.kde.org/plasma/kwin/-/merge_requests/2448>
353 +---
354 + src/toplevel.cpp | 3 ++-
355 + 1 file changed, 2 insertions(+), 1 deletion(-)
356 +
357 +diff --git a/src/toplevel.cpp b/src/toplevel.cpp
358 +index ff216835c4..5d3d7a5dde 100644
359 +--- a/src/toplevel.cpp
360 ++++ b/src/toplevel.cpp
361 +@@ -34,7 +34,8 @@ namespace KWin
362 + {
363 +
364 + Toplevel::Toplevel()
365 +- : m_visual(XCB_NONE)
366 ++ : m_output(workspace()->activeOutput())
367 ++ , m_visual(XCB_NONE)
368 + , bit_depth(24)
369 + , info(nullptr)
370 + , ready_for_painting(false)
371 +--
372 +GitLab
373 +
374
375 diff --git a/kde-plasma/kwin/files/kwin-5.24.5-update-device-outputName.patch b/kde-plasma/kwin/files/kwin-5.24.5-update-device-outputName.patch
376 new file mode 100644
377 index 000000000000..d1dbb3fb9bb8
378 --- /dev/null
379 +++ b/kde-plasma/kwin/files/kwin-5.24.5-update-device-outputName.patch
380 @@ -0,0 +1,32 @@
381 +From 1b96d21507a3b6b0a9ac6eac424d4e4db5602839 Mon Sep 17 00:00:00 2001
382 +From: David Redondo <kde@×××××××××××××.de>
383 +Date: Wed, 18 May 2022 13:34:45 +0200
384 +Subject: [PATCH] Update device outputName when setting output
385 +
386 +BUG:451279
387 +FIXED-IN:5.25.0
388 +
389 +
390 +(cherry picked from commit d3a37aa9aef58fbaedcef77d2797c22a015dc9c0)
391 +---
392 + src/backends/libinput/device.cpp | 2 ++
393 + 1 file changed, 2 insertions(+)
394 +
395 +diff --git a/src/backends/libinput/device.cpp b/src/backends/libinput/device.cpp
396 +index f247b66d74..30f51aca3c 100644
397 +--- a/src/backends/libinput/device.cpp
398 ++++ b/src/backends/libinput/device.cpp
399 +@@ -668,8 +668,10 @@ void Device::setOutput(AbstractOutput *output)
400 + {
401 + m_output = output;
402 + if (m_output) {
403 ++ m_outputName = output->name();
404 + writeEntry(ConfigKey::OutputName, output->name());
405 + } else {
406 ++ m_outputName = QString();
407 + writeEntry(ConfigKey::OutputName, QString());
408 + }
409 + Q_EMIT outputNameChanged();
410 +--
411 +GitLab
412 +
413
414 diff --git a/kde-plasma/kwin/kwin-5.24.5-r2.ebuild b/kde-plasma/kwin/kwin-5.24.5-r2.ebuild
415 new file mode 100644
416 index 000000000000..c4afd02c8fc6
417 --- /dev/null
418 +++ b/kde-plasma/kwin/kwin-5.24.5-r2.ebuild
419 @@ -0,0 +1,142 @@
420 +# Copyright 1999-2022 Gentoo Authors
421 +# Distributed under the terms of the GNU General Public License v2
422 +
423 +EAPI=8
424 +
425 +ECM_HANDBOOK="optional"
426 +ECM_TEST="optional"
427 +KFMIN=5.90.0
428 +PVCUT=$(ver_cut 1-3)
429 +QTMIN=5.15.2
430 +VIRTUALX_REQUIRED="test"
431 +inherit ecm kde.org optfeature
432 +
433 +DESCRIPTION="Flexible, composited Window Manager for windowing systems on Linux"
434 +
435 +LICENSE="GPL-2+"
436 +SLOT="5"
437 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
438 +IUSE="accessibility caps gles2-only multimedia plasma screencast"
439 +
440 +RESTRICT="test"
441 +
442 +COMMON_DEPEND="
443 + >=dev-libs/libinput-1.19
444 + >=dev-libs/wayland-1.2
445 + >=dev-qt/qtdbus-${QTMIN}:5
446 + >=dev-qt/qtdeclarative-${QTMIN}:5
447 + >=dev-qt/qtgui-${QTMIN}:5=[gles2-only=,libinput]
448 + >=dev-qt/qtwidgets-${QTMIN}:5
449 + >=dev-qt/qtx11extras-${QTMIN}:5
450 + >=kde-frameworks/kactivities-${KFMIN}:5
451 + >=kde-frameworks/kauth-${KFMIN}:5
452 + >=kde-frameworks/kcmutils-${KFMIN}:5
453 + >=kde-frameworks/kcompletion-${KFMIN}:5
454 + >=kde-frameworks/kconfig-${KFMIN}:5
455 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5
456 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
457 + >=kde-frameworks/kcrash-${KFMIN}:5
458 + >=kde-frameworks/kdbusaddons-${KFMIN}:5
459 + >=kde-frameworks/kdeclarative-${KFMIN}:5
460 + >=kde-frameworks/kglobalaccel-${KFMIN}:5=
461 + >=kde-frameworks/ki18n-${KFMIN}:5
462 + >=kde-frameworks/kiconthemes-${KFMIN}:5
463 + >=kde-frameworks/kidletime-${KFMIN}:5=
464 + >=kde-frameworks/knewstuff-${KFMIN}:5
465 + >=kde-frameworks/knotifications-${KFMIN}:5
466 + >=kde-frameworks/kpackage-${KFMIN}:5
467 + >=kde-frameworks/kservice-${KFMIN}:5
468 + >=kde-frameworks/ktextwidgets-${KFMIN}:5
469 + >=kde-frameworks/kwayland-${KFMIN}:5
470 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
471 + >=kde-frameworks/kwindowsystem-${KFMIN}:5=[X]
472 + >=kde-frameworks/kxmlgui-${KFMIN}:5
473 + >=kde-frameworks/plasma-${KFMIN}:5
474 + >=kde-plasma/breeze-${PVCUT}:5
475 + >=kde-plasma/kdecoration-${PVCUT}:5
476 + >=kde-plasma/kscreenlocker-${PVCUT}:5
477 + >=kde-plasma/kwayland-server-${PVCUT}:5
478 + media-libs/fontconfig
479 + media-libs/freetype
480 + media-libs/lcms:2
481 + media-libs/libepoxy
482 + >=media-libs/mesa-21.1[egl(+),gbm(+),wayland,X]
483 + virtual/libudev:=
484 + x11-libs/libX11
485 + x11-libs/libXi
486 + x11-libs/libdrm
487 + >=x11-libs/libxcb-1.10
488 + >=x11-libs/libxkbcommon-0.7.0
489 + x11-libs/xcb-util-cursor
490 + x11-libs/xcb-util-image
491 + x11-libs/xcb-util-keysyms
492 + x11-libs/xcb-util-wm
493 + accessibility? ( media-libs/libqaccessibilityclient:5 )
494 + caps? ( sys-libs/libcap )
495 + gles2-only? ( media-libs/mesa[gles2] )
496 + plasma? ( >=kde-frameworks/krunner-${KFMIN}:5 )
497 + screencast? ( >=media-video/pipewire-0.3:= )
498 +"
499 +RDEPEND="${COMMON_DEPEND}
500 + >=dev-qt/qtquickcontrols-${QTMIN}:5
501 + >=dev-qt/qtquickcontrols2-${QTMIN}:5
502 + >=dev-qt/qtvirtualkeyboard-${QTMIN}:5
503 + >=kde-frameworks/kirigami-${KFMIN}:5
504 + >=kde-frameworks/kitemmodels-${KFMIN}:5[qml]
505 + sys-apps/hwdata
506 + x11-base/xwayland
507 + multimedia? ( >=dev-qt/qtmultimedia-${QTMIN}:5[gstreamer,qml] )
508 +"
509 +DEPEND="${COMMON_DEPEND}
510 + >=dev-qt/designer-${QTMIN}:5
511 + >=dev-qt/qtconcurrent-${QTMIN}:5
512 + x11-base/xorg-proto
513 + test? (
514 + dev-libs/plasma-wayland-protocols
515 + >=dev-libs/wayland-protocols-1.19
516 + )
517 +"
518 +BDEPEND="test? ( >=dev-qt/qtwaylandscanner-${QTMIN}:5 )"
519 +PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5"
520 +
521 +PATCHES=(
522 + "${FILESDIR}"/${P}-fix-multi-gpu-double-copy.patch # KDE-bug 453386
523 + "${FILESDIR}"/${P}-tabbox-dont-dismiss-popups.patch # KDE-bug 446318
524 + "${FILESDIR}"/${P}-effects-overview-hide-panels.patch # KDE-bug 444274
525 + "${FILESDIR}"/${P}-fix-nvidia-render-glitches.patch
526 + "${FILESDIR}"/${P}-update-device-outputName.patch # KDE-bug 451279
527 + "${FILESDIR}"/${P}-fix-plasmashell-crash-{1,2}.patch # KDE-bugs 448064, 452433
528 +)
529 +
530 +src_prepare() {
531 + ecm_src_prepare
532 + use multimedia || eapply "${FILESDIR}/${PN}-5.21.80-gstreamer-optional.patch"
533 +
534 + # TODO: try to get a build switch upstreamed
535 + if ! use screencast; then
536 + sed -e "s/^pkg_check_modules.*PipeWire/#&/" -i CMakeLists.txt || die
537 + fi
538 +}
539 +
540 +src_configure() {
541 + local mycmakeargs=(
542 + $(cmake_use_find_package accessibility QAccessibilityClient)
543 + $(cmake_use_find_package caps Libcap)
544 + $(cmake_use_find_package plasma KF5Runner)
545 + )
546 +
547 + ecm_src_configure
548 +}
549 +
550 +pkg_postinst() {
551 + ecm_pkg_postinst
552 + optfeature "color management support" x11-misc/colord
553 + elog
554 + elog "In Plasma 5.20, default behavior of the Task Switcher to move minimised"
555 + elog "windows to the end of the list was changed so that it remains in the"
556 + elog "original order. To revert to the well established behavior:"
557 + elog
558 + elog " - Edit ~/.config/kwinrc"
559 + elog " - Find [TabBox] section"
560 + elog " - Add \"MoveMinimizedWindowsToEndOfTabBoxFocusChain=true\""
561 +}