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.
This commit is contained in:
Xaver Hugl 2021-04-12 19:40:16 +02:00
parent a461ff918d
commit 68f58076f4
2 changed files with 5 additions and 5 deletions

View file

@ -1004,7 +1004,7 @@ void AbstractClient::finishMoveResize(bool cancel)
checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment checkScreen(); // needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment
if (screen() != moveResizeStartScreen()) { if (screen() != moveResizeStartScreen()) {
if (isFullScreen() || isElectricBorderMaximizing()) { if (isFullScreen() || isElectricBorderMaximizing()) {
updateGeometryRestoresForFullscreen(); updateGeometryRestoresForFullscreen(screen());
} }
workspace()->sendClientToScreen(this, screen()); // checks rule validity workspace()->sendClientToScreen(this, screen()); // checks rule validity
if (maximizeMode() != MaximizeRestore) { if (maximizeMode() != MaximizeRestore) {
@ -3268,7 +3268,7 @@ void AbstractClient::sendToScreen(int newScreen)
} }
if (isFullScreen()) { if (isFullScreen()) {
updateGeometryRestoresForFullscreen(); updateGeometryRestoresForFullscreen(newScreen);
checkWorkspacePosition(oldGeom); checkWorkspacePosition(oldGeom);
} else { } else {
// align geom_restore - checkWorkspacePosition operates on it // align geom_restore - checkWorkspacePosition operates on it
@ -3292,9 +3292,9 @@ void AbstractClient::sendToScreen(int newScreen)
(*it)->sendToScreen(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; QRect newFullScreenGeometryRestore = screenArea;
if (!(maximizeMode() & MaximizeVertical)) { if (!(maximizeMode() & MaximizeVertical)) {
newFullScreenGeometryRestore.setHeight(geometryRestore().height()); newFullScreenGeometryRestore.setHeight(geometryRestore().height());

View file

@ -453,7 +453,7 @@ public:
*/ */
bool isSpecialWindow() const; bool isSpecialWindow() const;
void sendToScreen(int screen); void sendToScreen(int screen);
void updateGeometryRestoresForFullscreen(); void updateGeometryRestoresForFullscreen(int screen);
const QKeySequence &shortcut() const { const QKeySequence &shortcut() const {
return _shortcut; return _shortcut;
} }