From b7d1dbeb86709a680ec61453f9a787af4c860f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 10 Dec 2011 20:29:01 +0100 Subject: [PATCH] Honor rules in general isMaximizable/Minimizable/Shadeable queries REVIEW: 103379 --- client.cpp | 12 ++++++------ geometry.cpp | 13 +++++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client.cpp b/client.cpp index d5b4c5fa4f..8c00249884 100644 --- a/client.cpp +++ b/client.cpp @@ -945,6 +945,9 @@ bool Client::isMinimizable() const { if (isSpecialWindow()) return false; + if (!rules()->checkMinimize(true)) + return false; + if (isTransient()) { // #66868 - Let other xmms windows be minimized when the mainwindow is minimized bool shown_mainwindow = false; @@ -978,9 +981,6 @@ void Client::minimize(bool avoid_animation) { if (!isMinimizable() || isMinimized()) return; - if (!rules()->checkMinimize(true)) { - return; - } if (isShade()) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded info->setState(0, NET::Shaded); @@ -1068,13 +1068,13 @@ QRect Client::iconGeometry() const bool Client::isShadeable() const { - return !isSpecialWindow() && !noBorder(); + return !isSpecialWindow() && !noBorder() && (rules()->checkShade(ShadeNormal) != rules()->checkShade(ShadeNone)); } void Client::setShade(ShadeMode mode) { - if (!isShadeable()) - return; + if (isSpecialWindow() || noBorder()) + mode = ShadeNone; mode = rules()->checkShade(mode); if (shade_mode == mode) return; diff --git a/geometry.cpp b/geometry.cpp index 09f629dc56..0e134e03e8 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1852,7 +1852,9 @@ bool Client::isMaximizable() const if (!isMovable() || !isResizable() || isToolbar()) // SELI isToolbar() ? return false; } - return true; + if (rules()->checkMaximize(MaximizeRestore) == MaximizeRestore && rules()->checkMaximize(MaximizeFull) != MaximizeRestore) + return true; + return false; } @@ -2127,8 +2129,15 @@ void Client::setMaximize(bool vertically, bool horizontally) static bool changeMaximizeRecursion = false; void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) { - if (!isMaximizable() || changeMaximizeRecursion) + if (changeMaximizeRecursion) return; + { + // isMovable() and isResizable() may be false for maximized windows + // with moving/resizing maximized windows disabled + TemporaryAssign< MaximizeMode > tmp(max_mode, MaximizeRestore); + if (!isMovable() || !isResizable() || isToolbar()) // SELI isToolbar() ? + return; + } MaximizeMode old_mode = max_mode; // 'adjust == true' means to update the size only, e.g. after changing workspace size