From b74955dd2f39c651ea7f8337c2542e9fee69d42e Mon Sep 17 00:00:00 2001 From: Bert Gijsbers Date: Thu, 30 May 2024 19:38:58 +0200 Subject: [PATCH] Don't arrange, but only limit the position on screen dimension changes. --- src/wmframe.cc | 6 +++++- src/wmframe.h | 1 + src/wmmgr.cc | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/wmframe.cc b/src/wmframe.cc index 71c5d417c..02f9c6d7a 100644 --- a/src/wmframe.cc +++ b/src/wmframe.cc @@ -2106,7 +2106,7 @@ void YFrameWindow::maybeFocus() { } } -void YFrameWindow::focus(bool canWarp) { +void YFrameWindow::limitPos() { if (limitPosition && (x() >= int(desktop->width()) - borderX() || y() >= int(desktop->height()) - borderY() - titleY() || @@ -2125,6 +2125,10 @@ void YFrameWindow::focus(bool canWarp) { newY = int(- borderY()); setCurrentPositionOuter(newX, newY); } +} + +void YFrameWindow::focus(bool canWarp) { + limitPos(); manager->setFocus(this, canWarp); if (raiseOnFocus && manager->isRunning()) { wmRaise(); diff --git a/src/wmframe.h b/src/wmframe.h index 9c4622722..827eecfb4 100644 --- a/src/wmframe.h +++ b/src/wmframe.h @@ -54,6 +54,7 @@ class YFrameWindow: void createPointerWindows(); void grabKeys(); + void limitPos(); void maybeFocus(); void focus(bool canWarp = false); void activate(bool canWarp = false, bool curWork = true); diff --git a/src/wmmgr.cc b/src/wmmgr.cc index f8a0dba8b..6c4dc4006 100644 --- a/src/wmmgr.cc +++ b/src/wmmgr.cc @@ -3877,7 +3877,11 @@ void YWindowManager::updateScreenSize(XEvent *event) { /// TODO #warning "make something better" if (arrangeWindowsOnScreenSizeChange && resize) { - wmActionListener->actionPerformed(actionArrange, 0); + for (YFrameIter frame(focusedIterator()); ++frame; ) { + if (frame->visible()) { + frame->limitPos(); + } + } } if (resize) { arrangeIcons();