From 38849215d5c35afc5c2c7b77e9730f8808516d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 5 Jan 2015 14:04:43 +0100 Subject: [PATCH] Recursion check while decoration updates the borders Mostly a safety check, but fixes a crash with borderless maximized windows. If that option is set we also do not notify the decoration at all, as the deco will be destroyed anyway. BUG: 341675 REVIEW: 121858 --- geometry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geometry.cpp b/geometry.cpp index d472d8b165..3bf8da29aa 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2203,7 +2203,8 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) } // call into decoration update borders - if (m_decoration && m_decoration->client()) { + if (m_decoration && m_decoration->client() && !(options->borderlessMaximizedWindows() && max_mode == KWin::MaximizeFull)) { + changeMaximizeRecursion = true; const auto c = m_decoration->client().data(); if ((max_mode & MaximizeVertical) != (old_mode & MaximizeVertical)) { emit c->maximizedVerticallyChanged(max_mode & MaximizeVertical); @@ -2214,6 +2215,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) if ((max_mode == MaximizeFull) != (old_mode == MaximizeFull)) { emit c->maximizedChanged(max_mode & MaximizeFull); } + changeMaximizeRecursion = false; } // save sizes for restoring, if maximalizing