[plasma/kwin] src: window: fix vertical pullback in checkOffscreenPosition using width
Vlad Zahorodnii <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit f239b672cd9df21e444287993c1ed118faa832c4 by Vlad Zahorodnii, on behalf of zhang shoucheng.
Committed on 06/08/2026 at 08:03.
Pushed by vladz into branch 'master'.
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.
M +1 -1 src/window.cpp
https://invent.kde.org/plasma/kwin/-/commit/f239b672cd9df21e444287993c1ed118faa832c4
diff --git a/src/window.cpp b/src/window.cpp
index 3083db7740b..fd09bb9b0fe 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4210,7 +4210,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);
}
}