From 68f58076f40ede1c0d69619ea9ece43936c5133a Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 12 Apr 2021 19:40:16 +0200 Subject: [PATCH] Fix sendToScreen for fullscreen apps screen() only gets updated after AbstractClient::sendToScreen if invoked by a shortcut or menu (as opposed to moveresize), so we can't use it in AbstractClient::updateGeometryRestoresForFullscreen as it points to the old screen. --- src/abstract_client.cpp | 8 ++++---- src/abstract_client.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 86f00ee87d..4d14fbbabd 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -1004,7 +1004,7 @@ void AbstractClient::finishMoveResize(bool cancel) checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment if (screen() != moveResizeStartScreen()) { if (isFullScreen() || isElectricBorderMaximizing()) { - updateGeometryRestoresForFullscreen(); + updateGeometryRestoresForFullscreen(screen()); } workspace()->sendClientToScreen(this, screen()); // checks rule validity if (maximizeMode() != MaximizeRestore) { @@ -3268,7 +3268,7 @@ void AbstractClient::sendToScreen(int newScreen) } if (isFullScreen()) { - updateGeometryRestoresForFullscreen(); + updateGeometryRestoresForFullscreen(newScreen); checkWorkspacePosition(oldGeom); } else { // align geom_restore - checkWorkspacePosition operates on it @@ -3292,9 +3292,9 @@ void AbstractClient::sendToScreen(int newScreen) (*it)->sendToScreen(newScreen); } -void AbstractClient::updateGeometryRestoresForFullscreen() +void AbstractClient::updateGeometryRestoresForFullscreen(int screen) { - QRect screenArea = workspace()->clientArea(MaximizeArea, screen(), desktop()); + QRect screenArea = workspace()->clientArea(MaximizeArea, screen, desktop()); QRect newFullScreenGeometryRestore = screenArea; if (!(maximizeMode() & MaximizeVertical)) { newFullScreenGeometryRestore.setHeight(geometryRestore().height()); diff --git a/src/abstract_client.h b/src/abstract_client.h index 2e5467eb08..7be88fdcc2 100644 --- a/src/abstract_client.h +++ b/src/abstract_client.h @@ -453,7 +453,7 @@ public: */ bool isSpecialWindow() const; void sendToScreen(int screen); - void updateGeometryRestoresForFullscreen(); + void updateGeometryRestoresForFullscreen(int screen); const QKeySequence &shortcut() const { return _shortcut; }