From 1876e8fd016e4dc5dee473e0d91e27027b20f7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 4 Oct 2011 11:40:16 +0200 Subject: [PATCH] ensure that moving between screens does not involve unrelated struts --- workspace.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workspace.cpp b/workspace.cpp index 04f0d08242..76ae51c71a 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1752,6 +1752,12 @@ void Workspace::sendClientToScreen(Client* c, int screen) QPoint(( geom.center().x() - old_sarea.center().x()) * sarea.width() / old_sarea.width() + sarea.center().x(), ( geom.center().y() - old_sarea.center().y()) * sarea.height() / old_sarea.height() + sarea.center().y())); c->setGeometry( geom ); + // If the window was inside the old screen area, explicitly make sure its inside also the new screen area. + // Calling checkWorkspacePosition() should ensure that, but when moving to a small screen the window could + // be big enough to overlap outside of the new screen area, making struts from other screens come into effect, + // which could alter the resulting geometry. + if( old_sarea.contains( oldgeom )) + c->keepInArea( sarea ); c->checkWorkspacePosition( oldgeom ); ClientList transients_stacking_order = ensureStackingOrder(c->transients()); for (ClientList::ConstIterator it = transients_stacking_order.constBegin();