fix sendToScreen for QuickTiled windows

two-fold issue
a) setMaximize implicitly sets QuickTileMaximize; setting it again toggles it off
b) setting quicktile mode needs to happen in keyboard mode and thenn the target
   still depends on the current windo position, so the untiled window needs to
   be in a sane location (while geom_restore will typically be off-screen when
   quick tiling by mouse)

BUG: 330819
FIXED-IN:4.11.7
REVIEW: 115521
This commit is contained in:
Thomas Lübking 2014-02-06 18:36:11 +01:00
parent e9a8ea24a6
commit aecd5af0b4

View file

@ -3294,11 +3294,20 @@ void Client::sendToScreen(int newScreen)
// so we clear the state first
MaximizeMode maxMode = maximizeMode();
QuickTileMode qtMode = (QuickTileMode)quick_tile_mode;
maximize(MaximizeRestore);
setQuickTileMode(QuickTileNone);
if (maxMode != MaximizeRestore)
maximize(MaximizeRestore);
if (qtMode != QuickTileNone)
setQuickTileMode(QuickTileNone, true);
QRect oldScreenArea = workspace()->clientArea(MaximizeArea, this);
QRect screenArea = workspace()->clientArea(MaximizeArea, newScreen, desktop());
// the window can have its center so that the position correction moves the new center onto
// the old screen, what will tile it where it is. Ie. the screen is not changed
// this happens esp. with electric border quicktiling
if (qtMode != QuickTileNone)
keepInArea(oldScreenArea);
QRect oldGeom = geometry();
QRect newGeom = oldGeom;
// move the window to have the same relative position to the center of the screen
@ -3328,8 +3337,8 @@ void Client::sendToScreen(int newScreen)
// eg. setting QuickTileNone would break maximization
if (maxMode != MaximizeRestore)
maximize(maxMode);
if (qtMode != QuickTileNone)
setQuickTileMode(qtMode);
if (qtMode != QuickTileNone && qtMode != quick_tile_mode)
setQuickTileMode(qtMode, true);
ClientList tso = workspace()->ensureStackingOrder(transients());
for (ClientList::ConstIterator it = tso.constBegin(), end = tso.constEnd(); it != end; ++it)