correctly align tabbing shade mode, including hover

REVIEW: 106258
BUG: 294410
FIXED-IN: 4.9.2
icc-effect-5.14.5
Thomas Lübking 2012-08-25 22:44:44 +02:00
parent 9f8228bb1c
commit 3b7c1fb69d
2 changed files with 10 additions and 6 deletions

View File

@ -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();
}

View File

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