summaryrefslogtreecommitdiff
path: root/kde-plasma
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-04-15 08:45:29 +0100
committerV3n3RiX <venerix@koprulu.sector>2025-04-15 08:45:29 +0100
commitdfd0139069bb79941b882fe714d38b7fc8dcdb16 (patch)
tree4a16c914900acf7edb5090bca6b6fc17aa87fc09 /kde-plasma
parent4e995247a9a9d45f0b265ab9120c6d31c0a1f0d9 (diff)
gentoo auto-resync : 15:04:2025 - 08:45:29
Diffstat (limited to 'kde-plasma')
-rw-r--r--kde-plasma/Manifest.gzbin11935 -> 11941 bytes
-rw-r--r--kde-plasma/kwin/Manifest6
-rw-r--r--kde-plasma/kwin/files/kwin-6.3.4-0001-drm-crash.patch44
-rw-r--r--kde-plasma/kwin/files/kwin-6.3.4-0002-layer-shell.patch92
-rw-r--r--kde-plasma/kwin/files/kwin-6.3.4-0003-renderloop-crash.patch35
-rw-r--r--kde-plasma/kwin/files/kwin-6.3.4-0004-xwayland.patch137
-rw-r--r--kde-plasma/kwin/files/kwin-6.3.4-0005-x11-crash.patch36
-rw-r--r--kde-plasma/kwin/kwin-6.3.4-r1.ebuild158
8 files changed, 508 insertions, 0 deletions
diff --git a/kde-plasma/Manifest.gz b/kde-plasma/Manifest.gz
index 1115af56cff6..292cf0c3a9b5 100644
--- a/kde-plasma/Manifest.gz
+++ b/kde-plasma/Manifest.gz
Binary files differ
diff --git a/kde-plasma/kwin/Manifest b/kde-plasma/kwin/Manifest
index 5ecba7b41ef7..a06686d58f66 100644
--- a/kde-plasma/kwin/Manifest
+++ b/kde-plasma/kwin/Manifest
@@ -1,5 +1,11 @@
+AUX kwin-6.3.4-0001-drm-crash.patch 1512 BLAKE2B 3f5165226f54217254a8108f4cdd95811f0d1a88fa6af6ed17315b877df4defb1dbbfa158c9b26ae7a1eba0061f7fdb26412d9e7162330894004edb90dd1f096 SHA512 9e871dafd5f51a8d77c44dda15ad4042b8907cad0e1f35a2482c3859b3d33157132d014c8cc2d0e4221eeb9624d1dbbc3e24fc45547ef44634aa509e40612b3c
+AUX kwin-6.3.4-0002-layer-shell.patch 3331 BLAKE2B 4bd6adcf39ecaa5902b24d1118be15887ac442c66fe493d291731a90149d030551cefabb44a3b78b2c2c7f5ecdabf14d7ee407fd70ae40af21e42d7ea4a4ce54 SHA512 e0806589af0e9dcc864aa90e31e64591937373d127e8b65f7bd4f83819282d84485093a9d75417d6598b81313f988e4ccb1c61e18c78a751241a52da788acde9
+AUX kwin-6.3.4-0003-renderloop-crash.patch 1564 BLAKE2B 8e539b1086ee19c4c19e91d237c710b0d99d718b732aef5b34bd1feb3c20b61baeabf10e210efe8a23386d04a61f17ebd9395bb6cd11c3e08a1f29ee1117bef7 SHA512 e12085e2545be87684225c7eb3290fcc51a2753b7181c2511902ea65872da23770ad6a4c7c85cf5bfcfd80efb381d27401db86d004961699e001dee65fba4b68
+AUX kwin-6.3.4-0004-xwayland.patch 4846 BLAKE2B a66611d5542b0e8a79bbb9b4a1280a9aded34a5b0149d2b64211d65df54877fd574db3d569533e760e5525e3223d123413b66baaa75b92f4676a00a836dfda1b SHA512 dec9ab530fed935a63292eeea4c55822d199f73fef0473fce5fcc652c455d0b1e58e4ac8bce0daf4399b7ea10bfa08289861d44df29ec08d3a3455c2904ee9e9
+AUX kwin-6.3.4-0005-x11-crash.patch 1115 BLAKE2B 7aab52e52eb5eb30a1148a391c34a658dedb18c576b5280f86f1dd1f010d7bdefa04389cf2e2477bd9640b164b0dd30ca1a1e94f2223c0981055601ea79a4479 SHA512 2e09bb56d31be5ed32924ce9450e11faa9c773d9a3c580770da64ff968a7309db1dd19963396d4094447eff5cd65f549ccb22a77eddc10a2004980314bc4efae
DIST kwin-6.2.5.tar.xz 8563352 BLAKE2B 9a1ac80c337722d6a6411c338ac31f14f542f6d84505cc65c66e1ceedea2b88cbc9dabba68c42acf5dbace28b62e04cadc09a010a7972bc5ceb22d79344033fe SHA512 06a78d41003f2fb676f3cadca21a1e26a0006b78dcd9188c09d92fbc45f934aa9e923a69013b1cb496396d924a1848feb136d3016d64e14eca9cc525743b095b
DIST kwin-6.3.4.tar.xz 8977144 BLAKE2B c60e38763f74ecfa137b3cb0c37af9e537242032d8c3df6be0df4d78836c07f7cf2ad0be35d3fc545a9fab2e543d7aefcacb1f0358f3c5d296545dc827e8d55a SHA512 34205039e0499a988babdb7081df4d908c2b1e8d93cd4f8d6fff14c275b54ab0f5e80b5ca830612f5176d11969e71fe4174b806fb9da3ab04580caa88463131f
EBUILD kwin-6.2.5.ebuild 4338 BLAKE2B 7d9ee1ed1aa206230a23efdbb00a9a12b3094ee803bc5dabc74baf5dfdfa325f56a93194e2ecb24863266271973ef3bb011d4fd4acaf595f445f5a4edba5a184 SHA512 044f0f5e4336069826772e335264d5968a620acad76fe73f8d9debe88bf51ac87ed5e980286a3089aaa17c99ef677c88fb7fd6ca7906455470d560eb8a5ea285
+EBUILD kwin-6.3.4-r1.ebuild 4708 BLAKE2B caaae015769bb45d8802964cec0dd98a51fcf42f96dd4ff71d6a3444c9a4a360219a83b1d617c78021dcc0d3ca381c9450dfb2b7c4149cddb83fbc6897e67217 SHA512 0d8810f4ddcd4c498bec193c1b71e68af6fc3b007a987f5d058d9d4e52190cf600eb14056569c8ad2d2124748420273adc4113b47ea741cff793b2a35ddd0009
EBUILD kwin-6.3.4.ebuild 4482 BLAKE2B 91d1b51badb93832235358a65bad3e4dffce9fdbb15ef3b6ed9a9897e52e45615991e6725794a93c68ba36b3235a8b4413986812582a7f42eb08c07047be02c3 SHA512 f0e7645f12a096e9edec213b3994afe72c5e9a3e2ffc8b4ca663adfcf7de96e11bde02452a5a4fceb95187cb980efcd6efbfdf8caf6701ea37dc56cc3e91c4cb
MISC metadata.xml 677 BLAKE2B 050345f8f8f489b3cb81e112c05fddedc738c8f136d409b8754c54494a02caf5671a66dd1ecd7cfb91f24ab11210c67f78c09c928a4daf16b3512600649551c5 SHA512 5134373a0ce30f351344c07df4a68f97a15bf3bdb061ba8ff3355a42da2281d64bb506cdcb5b1dad698fc2061b4a4a92e054e08c521acb327b84f968a7d936dc
diff --git a/kde-plasma/kwin/files/kwin-6.3.4-0001-drm-crash.patch b/kde-plasma/kwin/files/kwin-6.3.4-0001-drm-crash.patch
new file mode 100644
index 000000000000..c94bdddf4c96
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.3.4-0001-drm-crash.patch
@@ -0,0 +1,44 @@
+https://mail.kde.org/pipermail/distributions/2025-April/001573.html
+https://invent.kde.org/plasma/kwin/-/commit/93bf2f98ae22e654d997c7140b7fe9936fa3f2d3
+
+From 93bf2f98ae22e654d997c7140b7fe9936fa3f2d3 Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.hugl@gmail.com>
+Date: Thu, 10 Apr 2025 14:13:33 +0000
+Subject: [PATCH] backends/drm: also clean up pending commits with legacy
+ modesetting
+
+The thread is only created with atomic modesetting, but m_committed is set with
+legacy modesetting too, so it also has to be dealt with.
+
+This should address remaining cases of
+https://crash-reports.kde.org/share/issue/c27bccb6794a48349b42b70a4e655619/
+
+
+(cherry picked from commit d357c110f1d5d41f597bce731bb1b8f9eb8de598)
+
+Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
+---
+ src/backends/drm/drm_commit_thread.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/backends/drm/drm_commit_thread.cpp b/src/backends/drm/drm_commit_thread.cpp
+index 2b23b59bb35..49a2085ae9e 100644
+--- a/src/backends/drm/drm_commit_thread.cpp
++++ b/src/backends/drm/drm_commit_thread.cpp
+@@ -301,10 +301,10 @@ DrmCommitThread::~DrmCommitThread()
+ m_pong.notify_all();
+ }
+ m_thread->wait();
+- if (m_committed) {
+- m_committed->setDefunct();
+- m_gpu->addDefunctCommit(std::move(m_committed));
+- }
++ }
++ if (m_committed) {
++ m_committed->setDefunct();
++ m_gpu->addDefunctCommit(std::move(m_committed));
+ }
+ }
+
+--
+GitLab
diff --git a/kde-plasma/kwin/files/kwin-6.3.4-0002-layer-shell.patch b/kde-plasma/kwin/files/kwin-6.3.4-0002-layer-shell.patch
new file mode 100644
index 000000000000..874a0cef54c1
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.3.4-0002-layer-shell.patch
@@ -0,0 +1,92 @@
+https://invent.kde.org/plasma/kwin/-/merge_requests/7479
+
+From 6f9bc0f2bd51d8e70d0868858e02e3ac04498840 Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.hugl@gmail.com>
+Date: Tue, 18 Mar 2025 19:11:22 +0100
+Subject: [PATCH 1/2] layershellv1window: close the window when the desired
+ output gets removed
+
+Workspace::outputRemoved also gets emitted when the output is turned off, and it
+doesn't require taking special care to turn the output off before removing it.
+
+(cherry picked from commit 4ee32d7f71de7f7f9a24c44b9dc4dd31fd3be98f)
+---
+ src/layershellv1window.cpp | 8 ++++----
+ src/layershellv1window.h | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/layershellv1window.cpp b/src/layershellv1window.cpp
+index 0e044fcf183..b6e18dedd61 100644
+--- a/src/layershellv1window.cpp
++++ b/src/layershellv1window.cpp
+@@ -55,8 +55,8 @@ LayerShellV1Window::LayerShellV1Window(LayerSurfaceV1Interface *shellSurface,
+ connect(shellSurface->surface(), &SurfaceInterface::aboutToBeDestroyed,
+ this, &LayerShellV1Window::destroyWindow);
+
+- connect(output, &Output::enabledChanged,
+- this, &LayerShellV1Window::handleOutputEnabledChanged);
++ connect(workspace(), &Workspace::outputRemoved,
++ this, &LayerShellV1Window::handleOutputRemoved);
+
+ connect(shellSurface->surface(), &SurfaceInterface::sizeChanged,
+ this, &LayerShellV1Window::handleSizeChanged);
+@@ -338,9 +338,9 @@ void LayerShellV1Window::handleAcceptsFocusChanged()
+ }
+ }
+
+-void LayerShellV1Window::handleOutputEnabledChanged()
++void LayerShellV1Window::handleOutputRemoved(Output *output)
+ {
+- if (!m_desiredOutput->isEnabled()) {
++ if (output == m_desiredOutput) {
+ closeWindow();
+ destroyWindow();
+ }
+diff --git a/src/layershellv1window.h b/src/layershellv1window.h
+index 923b5a6b4e0..9cdaa1d56a9 100644
+--- a/src/layershellv1window.h
++++ b/src/layershellv1window.h
+@@ -66,7 +66,7 @@ private:
+ void handleUnmapped();
+ void handleCommitted();
+ void handleAcceptsFocusChanged();
+- void handleOutputEnabledChanged();
++ void handleOutputRemoved(Output *output);
+ void scheduleRearrange();
+ void activateScreenEdge();
+ void deactivateScreenEdge();
+--
+GitLab
+
+
+From dc9dcc06f75ef12bd6c05d0c549414a5c1d3acea Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Thu, 3 Apr 2025 08:25:31 +0300
+Subject: [PATCH 2/2] Break Workspace::outputRemoved connection when a layer
+ shell window is destroyed
+
+So the destroyWindow() function is not called again when the Workspace
+emits the outputRemoved signal.
+
+(cherry picked from commit 23626717185a560df20615a252b2aba266ad756a)
+---
+ src/layershellv1window.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/layershellv1window.cpp b/src/layershellv1window.cpp
+index b6e18dedd61..2282ac147b8 100644
+--- a/src/layershellv1window.cpp
++++ b/src/layershellv1window.cpp
+@@ -204,7 +204,9 @@ void LayerShellV1Window::destroyWindow()
+ }
+ m_shellSurface->disconnect(this);
+ m_shellSurface->surface()->disconnect(this);
+- m_desiredOutput->disconnect(this);
++
++ disconnect(workspace(), &Workspace::outputRemoved,
++ this, &LayerShellV1Window::handleOutputRemoved);
+
+ markAsDeleted();
+ Q_EMIT closed();
+--
+GitLab
diff --git a/kde-plasma/kwin/files/kwin-6.3.4-0003-renderloop-crash.patch b/kde-plasma/kwin/files/kwin-6.3.4-0003-renderloop-crash.patch
new file mode 100644
index 000000000000..2991e2c09b11
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.3.4-0003-renderloop-crash.patch
@@ -0,0 +1,35 @@
+https://invent.kde.org/plasma/kwin/-/merge_requests/7496
+
+From 6d096dc5ad2e4a5fac6fb65552107473c0e55a6f Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Fri, 11 Apr 2025 12:30:12 +0000
+Subject: [PATCH] Fix a crash in RenderLoop::scheduleRepaint
+
+When kwin shuts down, the output layers may attempt to schedule a repaint
+after the workspace has been destroyed.
+
+SENTRY: KWIN-AYY
+
+
+(cherry picked from commit 534582e089d1dbed9a1e3d18031ac90cc364c570)
+
+Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+---
+ src/core/renderloop.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/renderloop.cpp b/src/core/renderloop.cpp
+index f2ef3ea213b..d997e2bf737 100644
+--- a/src/core/renderloop.cpp
++++ b/src/core/renderloop.cpp
+@@ -263,7 +263,7 @@ void RenderLoop::scheduleRepaint(Item *item, RenderLayer *layer, OutputLayer *ou
+ }
+ const bool vrr = d->presentationMode == PresentationMode::AdaptiveSync || d->presentationMode == PresentationMode::AdaptiveAsync;
+ const bool tearing = d->presentationMode == PresentationMode::Async || d->presentationMode == PresentationMode::AdaptiveAsync;
+- if ((vrr || tearing) && workspace()->activeWindow() && d->output) {
++ if ((vrr || tearing) && workspace() && workspace()->activeWindow() && d->output) {
+ Window *const activeWindow = workspace()->activeWindow();
+ if ((item || layer || outputLayer) && activeWindowControlsVrrRefreshRate() && item != activeWindow->surfaceItem()) {
+ d->delayedVrrTimer.start();
+--
+GitLab
diff --git a/kde-plasma/kwin/files/kwin-6.3.4-0004-xwayland.patch b/kde-plasma/kwin/files/kwin-6.3.4-0004-xwayland.patch
new file mode 100644
index 000000000000..63ab9a36f072
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.3.4-0004-xwayland.patch
@@ -0,0 +1,137 @@
+https://invent.kde.org/plasma/kwin/-/merge_requests/7497
+
+From de5253a788841179a9f167476d34ae0747ce0d67 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Fri, 4 Apr 2025 14:34:32 +0300
+Subject: [PATCH] Simplify xwayland surface association
+
+When kwin starts managing or tracking an X11 window, there should not be
+any wl_surface associated with the X11 window.
+
+While on this, also slightly rewire the code so the associate() function
+is not called indirectly by setSurface(). It allows us to find all relevant
+places where the wl_surface is associated by using code navigation tools
+such as "find all references".
+
+(cherry picked from commit cbb86e609b7b39042fb666f6a736f28196ad2cea)
+---
+ src/events.cpp | 2 +-
+ src/wayland_server.cpp | 4 ++--
+ src/x11window.cpp | 15 ++++-----------
+ src/x11window.h | 4 +++-
+ 4 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/src/events.cpp b/src/events.cpp
+index 6f73c712631..b3afa19ead6 100644
+--- a/src/events.cpp
++++ b/src/events.cpp
+@@ -658,7 +658,7 @@ void X11Window::clientMessageEvent(xcb_client_message_event_t *e)
+ m_surfaceSerial = (uint64_t(e->data.data32[1]) << 32) | e->data.data32[0];
+ if (auto w = waylandServer()) {
+ if (XwaylandSurfaceV1Interface *xwaylandSurface = w->xwaylandShell()->findSurface(m_surfaceSerial)) {
+- setSurface(xwaylandSurface->surface());
++ associate(xwaylandSurface);
+ }
+ }
+ }
+diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp
+index 1278713b8d1..6bd34758442 100644
+--- a/src/wayland_server.cpp
++++ b/src/wayland_server.cpp
+@@ -350,7 +350,7 @@ bool WaylandServer::init()
+ return window->surfaceSerial() == surface->serial();
+ });
+ if (window) {
+- window->setSurface(surface->surface());
++ window->associate(surface);
+ return;
+ }
+
+@@ -358,7 +358,7 @@ bool WaylandServer::init()
+ return window->surfaceSerial() == surface->serial();
+ });
+ if (unmanaged) {
+- unmanaged->setSurface(surface->surface());
++ unmanaged->associate(surface);
+ return;
+ }
+ });
+diff --git a/src/x11window.cpp b/src/x11window.cpp
+index 1a5c4c16fb2..ab9410bc7a9 100644
+--- a/src/x11window.cpp
++++ b/src/x11window.cpp
+@@ -33,6 +33,7 @@
+ #include "tiles/tilemanager.h"
+ #include "virtualdesktops.h"
+ #include "wayland/surface.h"
++#include "wayland/xwaylandshell_v1.h"
+ #include "wayland_server.h"
+ #include "workspace.h"
+ #include <KDecoration3/DecoratedWindow>
+@@ -588,11 +589,6 @@ bool X11Window::track(xcb_window_t w)
+ switch (kwinApp()->operationMode()) {
+ case Application::OperationModeWayland:
+ // The wayland surface is associated with the override-redirect window asynchronously.
+- if (surface()) {
+- associate();
+- } else {
+- connect(this, &Window::surfaceChanged, this, &X11Window::associate);
+- }
+ break;
+ case Application::OperationModeX11:
+ // We have no way knowing whether the override-redirect window can be painted. Mark it
+@@ -1207,11 +1203,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped)
+ switch (kwinApp()->operationMode()) {
+ case Application::OperationModeWayland:
+ // The wayland surface is associated with the window asynchronously.
+- if (surface()) {
+- associate();
+- } else {
+- connect(this, &Window::surfaceChanged, this, &X11Window::associate);
+- }
+ connect(kwinApp(), &Application::xwaylandScaleChanged, this, &X11Window::handleXwaylandScaleChanged);
+ break;
+ case Application::OperationModeX11:
+@@ -5027,8 +5018,10 @@ void X11Window::updateWindowPixmap()
+ }
+ }
+
+-void X11Window::associate()
++void X11Window::associate(XwaylandSurfaceV1Interface *shellSurface)
+ {
++ setSurface(shellSurface->surface());
++
+ if (surface()->isMapped()) {
+ if (m_syncRequest.acked) {
+ finishSync();
+diff --git a/src/x11window.h b/src/x11window.h
+index 797f600d4fb..d97f93764c1 100644
+--- a/src/x11window.h
++++ b/src/x11window.h
+@@ -39,6 +39,7 @@ namespace KWin
+ {
+
+ class KillPrompt;
++class XwaylandSurfaceV1Interface;
+
+ /**
+ * @brief Defines Predicates on how to search for a Client.
+@@ -82,6 +83,8 @@ public:
+ explicit X11Window();
+ ~X11Window() override; ///< Use destroyWindow() or releaseWindow()
+
++ void associate(XwaylandSurfaceV1Interface *shellSurface);
++
+ xcb_window_t frameId() const;
+ xcb_window_t window() const;
+ xcb_window_t wrapperId() const;
+@@ -439,7 +442,6 @@ private:
+
+ QWindow *findInternalWindow() const;
+ void checkOutput();
+- void associate();
+ void handleXwaylandScaleChanged();
+ void handleCommitted();
+
+--
+GitLab
diff --git a/kde-plasma/kwin/files/kwin-6.3.4-0005-x11-crash.patch b/kde-plasma/kwin/files/kwin-6.3.4-0005-x11-crash.patch
new file mode 100644
index 000000000000..42a44bb2ccb1
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.3.4-0005-x11-crash.patch
@@ -0,0 +1,36 @@
+https://invent.kde.org/plasma/kwin/-/merge_requests/7498
+
+From 3be0acf56938800be682b0150214fcf9cc3da127 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Fri, 11 Apr 2025 14:23:02 +0000
+Subject: [PATCH] Disconnect committed signal in X11Window::associate()
+
+It's possible that a new surface can be assigned while the previous
+surface is still alive, in which case we want to ignore its committed
+signal.
+
+
+(cherry picked from commit 194cb54eba26e863d5e7c23bda1e2e146f839d9e)
+
+Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+---
+ src/x11window.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/x11window.cpp b/src/x11window.cpp
+index ab9410bc7a..218bc76af9 100644
+--- a/src/x11window.cpp
++++ b/src/x11window.cpp
+@@ -5020,6 +5020,10 @@ void X11Window::updateWindowPixmap()
+
+ void X11Window::associate(XwaylandSurfaceV1Interface *shellSurface)
+ {
++ if (surface()) {
++ disconnect(surface(), &SurfaceInterface::committed, this, &X11Window::handleCommitted);
++ }
++
+ setSurface(shellSurface->surface());
+
+ if (surface()->isMapped()) {
+--
+GitLab
diff --git a/kde-plasma/kwin/kwin-6.3.4-r1.ebuild b/kde-plasma/kwin/kwin-6.3.4-r1.ebuild
new file mode 100644
index 000000000000..5e54d6abef7a
--- /dev/null
+++ b/kde-plasma/kwin/kwin-6.3.4-r1.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=6.10.0
+QTMIN=6.8.1
+inherit ecm fcaps plasma.kde.org xdg
+
+DESCRIPTION="Flexible, composited Window Manager for windowing systems on Linux"
+
+LICENSE="GPL-2+"
+SLOT="6"
+KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="accessibility gles2-only lock screencast +shortcuts systemd"
+
+RESTRICT="test"
+
+# qtbase slot op: GuiPrivate use in tabbox
+# qtbase[X]: private/qtx11extras_p.h in src/helpers/killer
+COMMON_DEPEND="
+ dev-libs/libei
+ >=dev-libs/libinput-1.27:=
+ >=dev-libs/wayland-1.23.0
+ >=dev-qt/qt5compat-${QTMIN}:6[qml]
+ >=dev-qt/qtbase-${QTMIN}:6=[accessibility=,gles2-only=,gui,libinput,opengl,widgets,X]
+ >=dev-qt/qtdeclarative-${QTMIN}:6
+ >=dev-qt/qtsensors-${QTMIN}:6
+ >=dev-qt/qtshadertools-${QTMIN}:6
+ >=dev-qt/qtsvg-${QTMIN}:6
+ >=dev-qt/qtwayland-${QTMIN}:6
+ >=kde-frameworks/kauth-${KFMIN}:6
+ >=kde-frameworks/kcmutils-${KFMIN}:6
+ >=kde-frameworks/kcolorscheme-${KFMIN}:6
+ >=kde-frameworks/kconfig-${KFMIN}:6[qml]
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:6
+ >=kde-frameworks/kcoreaddons-${KFMIN}:6
+ >=kde-frameworks/kcrash-${KFMIN}:6
+ >=kde-frameworks/kdbusaddons-${KFMIN}:6
+ >=kde-frameworks/kdeclarative-${KFMIN}:6
+ >=kde-frameworks/kglobalaccel-${KFMIN}:6=[X(+)]
+ >=kde-frameworks/kguiaddons-${KFMIN}:6[wayland]
+ >=kde-frameworks/ki18n-${KFMIN}:6
+ >=kde-frameworks/kidletime-${KFMIN}:6=[wayland]
+ >=kde-frameworks/knewstuff-${KFMIN}:6
+ >=kde-frameworks/knotifications-${KFMIN}:6
+ >=kde-frameworks/kpackage-${KFMIN}:6
+ >=kde-frameworks/kservice-${KFMIN}:6
+ >=kde-frameworks/ksvg-${KFMIN}:6
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:6
+ >=kde-frameworks/kwindowsystem-${KFMIN}:6=[wayland,X]
+ >=kde-frameworks/kxmlgui-${KFMIN}:6
+ >=kde-plasma/breeze-${KDE_CATV}:6
+ >=kde-plasma/kdecoration-${KDE_CATV}:6
+ >=kde-plasma/kwayland-${KDE_CATV}:6
+ >=kde-plasma/plasma-activities-${KDE_CATV}:6
+ media-libs/fontconfig
+ media-libs/freetype
+ media-libs/lcms:2
+ media-libs/libcanberra
+ >=media-libs/libdisplay-info-0.2.0:=
+ media-libs/libepoxy
+ media-libs/libglvnd
+ >=media-libs/mesa-24.1.0_rc1[opengl,wayland,X]
+ virtual/libudev:=
+ x11-libs/libX11
+ x11-libs/libXi
+ >=x11-libs/libdrm-2.4.116
+ >=x11-libs/libxcb-1.10:=
+ >=x11-libs/libxcvt-0.1.1
+ >=x11-libs/libxkbcommon-1.5.0
+ x11-libs/xcb-util-cursor
+ x11-libs/xcb-util-keysyms
+ x11-libs/xcb-util-wm
+ accessibility? ( media-libs/libqaccessibilityclient:6 )
+ lock? ( >=kde-plasma/kscreenlocker-${KDE_CATV}:6 )
+ screencast? ( >=media-video/pipewire-1.2.0:= )
+ shortcuts? ( >=kde-plasma/kglobalacceld-${KDE_CATV}:6 )
+"
+RDEPEND="${COMMON_DEPEND}
+ !kde-plasma/kdeplasma-addons:5
+ >=dev-qt/qtmultimedia-${QTMIN}:6[qml]
+ || (
+ dev-qt/qtmultimedia:6[ffmpeg]
+ (
+ dev-qt/qtmultimedia:6[gstreamer]
+ media-plugins/gst-plugins-soup:1.0
+ )
+ )
+ >=kde-frameworks/kirigami-${KFMIN}:6
+ >=kde-frameworks/kitemmodels-${KFMIN}:6
+ >=kde-plasma/aurorae-${KDE_CATV}:6
+ >=kde-plasma/libplasma-${KDE_CATV}:6[wayland(+)]
+ sys-apps/hwdata
+ >=x11-base/xwayland-23.1.0[libei]
+"
+DEPEND="${COMMON_DEPEND}
+ >=dev-libs/plasma-wayland-protocols-1.16.0
+ >=dev-libs/wayland-protocols-1.38
+ >=dev-qt/qttools-${QTMIN}:6[widgets]
+ >=dev-qt/qtbase-${QTMIN}:6[concurrent]
+ x11-base/xorg-proto
+ x11-libs/xcb-util-image
+ test? ( screencast? ( >=kde-plasma/kpipewire-${KDE_CATV}:6 ) )
+"
+BDEPEND="
+ >=dev-qt/qtwayland-${QTMIN}:6
+ dev-util/wayland-scanner
+ >=kde-frameworks/kcmutils-${KFMIN}:6
+"
+
+# https://bugs.gentoo.org/941628
+# -m 0755 to avoid suid with USE="-filecaps"
+FILECAPS=( -m 0755 cap_sys_nice=ep usr/bin/kwin_wayland )
+
+PATCHES=(
+ "${FILESDIR}"/${P}-0001-drm-crash.patch
+ "${FILESDIR}"/${P}-0002-layer-shell.patch
+ "${FILESDIR}"/${P}-0003-renderloop-crash.patch
+ "${FILESDIR}"/${P}-0004-xwayland.patch
+ "${FILESDIR}"/${P}-0005-x11-crash.patch
+)
+
+src_prepare() {
+ ecm_src_prepare
+
+ # TODO: try to get a build switch upstreamed
+ if ! use screencast; then
+ sed -e "s/^pkg_check_modules.*PipeWire/#&/" -i CMakeLists.txt || die
+ fi
+
+ # TODO: try to get a build switch upstreamed
+ if ! use systemd; then
+ sed -e "s/^pkg_check_modules.*libsystemd/#&/" -i CMakeLists.txt || die
+ fi
+
+ cmake_run_in src/plugins cmake_comment_add_subdirectory kdecorations
+}
+
+src_configure() {
+ local mycmakeargs=(
+ # TODO: KWIN_BUILD_X11=$(usex xwayland) KWIN_BUILD_X11_BACKEND=$(usex X)
+ # KWIN_BUILD_NOTIFICATIONS exists, but kdeclarative still hard-depends on it
+ $(cmake_use_find_package accessibility QAccessibilityClient6)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Libcap=ON
+ -DKWIN_BUILD_SCREENLOCKER=$(usex lock)
+ -DKWIN_BUILD_GLOBALSHORTCUTS=$(usex shortcuts)
+ )
+
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ fcaps_pkg_postinst
+}