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) {