commit:     02652d44b11f9ff3228befa4078e80e4576aebd7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  6 20:42:06 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb  6 20:42:16 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02652d44

kde-plasma/kwin: backport deactivate-screen fix

Closes: https://bugs.gentoo.org/969528
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../kwin/files/kwin-6.5.5-screen-disable.patch     | 51 ++++++++++++++++++++++
 .../{kwin-6.5.5-r1.ebuild => kwin-6.5.5-r2.ebuild} |  1 +
 2 files changed, 52 insertions(+)

diff --git a/kde-plasma/kwin/files/kwin-6.5.5-screen-disable.patch 
b/kde-plasma/kwin/files/kwin-6.5.5-screen-disable.patch
new file mode 100644
index 000000000000..41465e06d2a0
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-6.5.5-screen-disable.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/969528
+https://mail.kde.org/pipermail/distributions/2026-January/001671.html
+https://invent.kde.org/plasma/kwin/-/commit/f79af348ed9f18bc30417df4bfe539383fd9fa77
+
+From f79af348ed9f18bc30417df4bfe539383fd9fa77 Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <[email protected]>
+Date: Wed, 21 Jan 2026 23:52:12 +0100
+Subject: [PATCH] wayland/outputmanagement: re-allow negative positions for
+ disabled outputs
+
+KScreen normalizes output positions, so that one of the enabled outputs has
+x = 0 and one has y = 0.
+While doing that, it sometimes moves disabled outputs to negative positions, so
+they stay in the same spot relative to the enabled ones. Right now that means
+turning off an output with some setups leads to that configuration being
+rejected, for reasons the user can't follow.
+
+Ideally KScreen will be fixed so it doesn't ever move outputs around and just
+accepts that no output will be at position zero, but I'm a bit concerned about
+negatively affecting the X11 session.
+Until Xorg is dropped, this workaround should be fine.
+
+(cherry picked from commit aa1a44454b106be344466e10f972bcb97a846cad)
+---
+ src/wayland/outputmanagement_v2.cpp | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/wayland/outputmanagement_v2.cpp 
b/src/wayland/outputmanagement_v2.cpp
+index 85022a16ebb..2c579ee0219 100644
+--- a/src/wayland/outputmanagement_v2.cpp
++++ b/src/wayland/outputmanagement_v2.cpp
+@@ -524,8 +524,15 @@ void 
OutputConfigurationV2Interface::kde_output_configuration_v2_apply(Resource
+             continue;
+         }
+         if (changeset->pos.has_value()) {
+-            if (changeset->pos->x() < 0 || changeset->pos->y() < 0) {
+-                sendFailure(resource, QString("Position of output %1 is 
negative, that is not supported").arg(output->name()));
++            // KScreen in some cases moves disabled screens to negative 
positions, to preserve their
++            // relative position vs. the still enabled outputs. Until that's 
changed, we have to allow
++            // disabled outputs to be in negative positions
++            const bool enabled = 
changeset->enabled.value_or(output->isEnabled());
++            if (!enabled && (changeset->pos->x() < -1000000 || 
changeset->pos->y() < -1000000)) {
++                sendFailure(resource, QStringLiteral("Position of output %1 
is way too negative (%2, 
%3)").arg(output->name()).arg(changeset->pos->x()).arg(changeset->pos->y()));
++                return;
++            } else if (enabled && (changeset->pos->x() < 0 || 
changeset->pos->y() < 0)) {
++                sendFailure(resource, QStringLiteral("Position of enabled 
output %1 is negative (%2, 
%3)").arg(output->name()).arg(changeset->pos->x()).arg(changeset->pos->y()));
+                 return;
+             }
+             if (changeset->pos->x() > 1000000 || changeset->pos->y() > 
1000000) {
+-- 
+GitLab

diff --git a/kde-plasma/kwin/kwin-6.5.5-r1.ebuild 
b/kde-plasma/kwin/kwin-6.5.5-r2.ebuild
similarity index 98%
rename from kde-plasma/kwin/kwin-6.5.5-r1.ebuild
rename to kde-plasma/kwin/kwin-6.5.5-r2.ebuild
index 0c13cd58e318..60195538bd53 100644
--- a/kde-plasma/kwin/kwin-6.5.5-r1.ebuild
+++ b/kde-plasma/kwin/kwin-6.5.5-r2.ebuild
@@ -111,6 +111,7 @@ FILECAPS=( -m 0755 cap_sys_nice=ep usr/bin/kwin_wayland )
 PATCHES=(
        "${WORKDIR}/${P}-patchset"
        "${FILESDIR}/${P}-unused-deps.patch" # bug #965053
+       "${FILESDIR}/${P}-screen-disable.patch" # bug #969528
 )
 
 pkg_pretend() {

Reply via email to