From 3b7c1fb69ddb4cf843773e81d546fe84963014ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 25 Aug 2012 22:44:44 +0200 Subject: [PATCH] correctly align tabbing shade mode, including hover REVIEW: 106258 BUG: 294410 FIXED-IN: 4.9.2 --- client.cpp | 12 ++++++++---- tabgroup.cpp | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client.cpp b/client.cpp index fefdb4036c..cf35783b9c 100644 --- a/client.cpp +++ b/client.cpp @@ -1071,6 +1071,11 @@ void Client::setShade(ShadeMode mode) bool was_shade = isShade(); ShadeMode was_shade_mode = shade_mode; shade_mode = mode; + + // Update states of all other windows in this group + if (tabGroup()) + tabGroup()->updateStates(this, TabGroup::Shaded); + if (was_shade == isShade()) { if (decoration != NULL) // Decoration may want to update after e.g. hover-shade changes decoration->shadeChange(); @@ -1148,9 +1153,6 @@ void Client::setShade(ShadeMode mode) decoration->shadeChange(); updateWindowRules(Rules::Shade); - // Update states of all other windows in this group - if (tabGroup()) - tabGroup()->updateStates(this, TabGroup::Shaded); emit shadeChanged(); } @@ -1162,7 +1164,9 @@ void Client::shadeHover() void Client::shadeUnhover() { - setShade(ShadeNormal); + if (!tabGroup() || tabGroup()->current() == this || + tabGroup()->current()->shadeMode() == ShadeNormal) + setShade(ShadeNormal); cancelShadeHoverTimer(); } diff --git a/tabgroup.cpp b/tabgroup.cpp index dd2ae11c99..7fbde4d16a 100644 --- a/tabgroup.cpp +++ b/tabgroup.cpp @@ -326,8 +326,8 @@ void TabGroup::updateStates(Client* main, States states, Client* only) if ((states & Maximized) && c->maximizeMode() != main->maximizeMode()) c->maximize(main->maximizeMode()); // the order Shaded -> Geometry is somewhat important because one will change the other - if ((states & Shaded) && c->isShade() != main->isShade()) - c->setShade(main->isShade() ? ShadeNormal : ShadeNone); + if ((states & Shaded)) + c->setShade(main->shadeMode()); if ((states & Geometry) && c->geometry() != main->geometry()) c->setGeometry(main->geometry()); if (states & Desktop) {