From dd05eebbe2dd27f529271e7dbac015a00207620c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 8 Sep 2011 23:05:50 +0200 Subject: [PATCH] catch changeMaximize recursion from setNoBorder polluted the restore geometry for unmaximizing from quick maximization when using BorderlessMax'd CCBUG: 279529 (cherry picked from commit 5ca44bfd7dce34504ff5fdc25818470bc672e358) --- geometry.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 0f4224d91f..5c7cbe5d5b 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2101,9 +2101,10 @@ void Client::setMaximize(bool vertically, bool horizontally) clientGroup()->updateStates(this); } +static bool changeMaximizeRecursion = false; void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) { - if (!isMaximizable()) + if (!isMaximizable() || changeMaximizeRecursion) return; MaximizeMode old_mode = max_mode; @@ -2134,8 +2135,13 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) else clientArea = workspace()->clientArea(MaximizeArea, this); - if (options->borderlessMaximizedWindows()) + if (options->borderlessMaximizedWindows()) { + // triggers a maximize change. + // The next setNoBorder interation will exit since there's no change but the first recursion pullutes the restore/pretile geometry + changeMaximizeRecursion = true; setNoBorder(app_noborder || max_mode == MaximizeFull); + changeMaximizeRecursion = false; + } // save sizes for restoring, if maximalizing if (!adjust && !(old_mode & MaximizeVertical)) {