From 49fff98f048a91012d8afd416afd59afdcc6f958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 24 Apr 2012 20:17:09 +0200 Subject: [PATCH] sanitize geom_restore if the window gets quickly untiled after initially being maximized BUG: 298646 REVIEW: 104715 FIXED-IN: 4.9 --- geometry.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/geometry.cpp b/geometry.cpp index a79e940abe..4da7d29d11 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2246,6 +2246,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) restore.moveLeft(geom_restore.x()); if (geom_restore.height() > 0) restore.moveTop(geom_restore.y()); + geom_restore = restore; // relevant for mouse pos calculation, bug #298646 } setGeometry(restore, geom_mode); if (!clientArea.contains(geom_restore.center())) // Not restoring to the same screen @@ -3137,6 +3138,8 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) // is the same as explicitly untiling this window, so allow it. if (mode == QuickTileNone || ((quick_tile_mode & QuickTileHorizontal) && (mode & QuickTileHorizontal))) { // Untiling, so just restore geometry, and we're done. + if (!geom_restore.isValid()) // invalid if we started maximized and wait for placement + geom_restore = geometry(); setGeometry(geom_restore); quick_tile_mode = QuickTileNone; checkWorkspacePosition(); // Just in case it's a different screen