[plasma/kwin/Plasma/6.7] src: window: fix vertical pullback in checkOffscreenPosition using width
Vlad Zahorodnii <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 17b4440514fb6ddc7d47286677737e478dc3f95e by Vlad Zahorodnii, on behalf of zhang shoucheng.
Committed on 06/08/2026 at 08:57.
Pushed by vladz into branch 'Plasma/6.7'.
window: fix vertical pullback in checkOffscreenPosition using width
When a window ended up entirely above the screen, the fallback position
used screenArea.width() / 4 instead of height() / 4, pulling the window
back by the wrong amount on non-square screens. Use height() for the
vertical branch to match the other three directions.
(cherry picked from commit f239b672cd9df21e444287993c1ed118faa832c4)
M +1 -1 src/window.cpp
https://invent.kde.org/plasma/kwin/-/commit/17b4440514fb6ddc7d47286677737e478dc3f95e
diff --git a/src/window.cpp b/src/window.cpp
index aedd275a554..3b18c4b1e34 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4126,7 +4126,7 @@ void Window::checkOffscreenPosition(RectF *geom, const RectF &screenArea)
if (geom->top() > screenArea.bottom()) {
geom->moveTop(screenArea.bottom() - screenArea.height() / 4);
} else if (geom->bottom() < screenArea.top()) {
- geom->moveBottom(screenArea.top() + screenArea.width() / 4);
+ geom->moveBottom(screenArea.top() + screenArea.height() / 4);
}
}