[plasma/kwin] src/backends/wayland: backends/wayland: Set explicit window geometry

Vlad Zahorodnii <[email protected]> Tue, 4 Aug 2026 11:28:25 +0000 (UTC)
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9e45d0b3ff7d35a91582b7449cd42f638396de8c by Vlad Zahorodnii.
Committed on 04/08/2026 at 10:55.
Pushed by vladz into branch 'master'.

backends/wayland: Set explicit window geometry

So when the cursor is a sub-surface and it's partially outside the main
surface, kwin doesn't use the bounding rectangle of the main surface as
the xdg window geometry. That will look bad.

M  +3    -1    src/backends/wayland/wayland_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/9e45d0b3ff7d35a91582b7449cd42f638396de8c

diff --git a/src/backends/wayland/wayland_output.cpp b/src/backends/wayland/wayland_output.cpp
index 23f885b7213..344ee3a1c94 100644
--- a/src/backends/wayland/wayland_output.cpp
+++ b/src/backends/wayland/wayland_output.cpp
@@ -311,7 +311,9 @@ bool WaylandOutput::present(const QList<OutputLayer *> &layersToUpdate, const st
         m_surface->attachBuffer(buffer);
         m_mapped = true;
     }
-    m_viewport->setDestination(QSize(std::round(modeSize().width() / scale()), std::round(modeSize().height() / scale())));
+    const Rect rect(QPoint(), QSize(std::round(modeSize().width() / scale()), std::round(modeSize().height() / scale())));
+    m_xdgShellSurface->setWindowGeometry(rect);
+    m_viewport->setDestination(rect.size());
     m_surface->setScale(1);
     // commit the subsurfaces before the main surface
     for (OutputLayer *layer : layersToUpdate) {