correctly align tabbing shade mode, including hover

REVIEW: 106258
BUG: 294410
FIXED-IN: 4.9.2
This commit is contained in:
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(); bool was_shade = isShade();
ShadeMode was_shade_mode = shade_mode; ShadeMode was_shade_mode = shade_mode;
shade_mode = 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 (was_shade == isShade()) {
if (decoration != NULL) // Decoration may want to update after e.g. hover-shade changes if (decoration != NULL) // Decoration may want to update after e.g. hover-shade changes
decoration->shadeChange(); decoration->shadeChange();
@ -1148,9 +1153,6 @@ void Client::setShade(ShadeMode mode)
decoration->shadeChange(); decoration->shadeChange();
updateWindowRules(Rules::Shade); updateWindowRules(Rules::Shade);
// Update states of all other windows in this group
if (tabGroup())
tabGroup()->updateStates(this, TabGroup::Shaded);
emit shadeChanged(); emit shadeChanged();
} }
@ -1162,7 +1164,9 @@ void Client::shadeHover()
void Client::shadeUnhover() void Client::shadeUnhover()
{ {
setShade(ShadeNormal); if (!tabGroup() || tabGroup()->current() == this ||
tabGroup()->current()->shadeMode() == ShadeNormal)
setShade(ShadeNormal);
cancelShadeHoverTimer(); cancelShadeHoverTimer();
} }

View file

@ -326,8 +326,8 @@ void TabGroup::updateStates(Client* main, States states, Client* only)
if ((states & Maximized) && c->maximizeMode() != main->maximizeMode()) if ((states & Maximized) && c->maximizeMode() != main->maximizeMode())
c->maximize(main->maximizeMode()); c->maximize(main->maximizeMode());
// the order Shaded -> Geometry is somewhat important because one will change the other // the order Shaded -> Geometry is somewhat important because one will change the other
if ((states & Shaded) && c->isShade() != main->isShade()) if ((states & Shaded))
c->setShade(main->isShade() ? ShadeNormal : ShadeNone); c->setShade(main->shadeMode());
if ((states & Geometry) && c->geometry() != main->geometry()) if ((states & Geometry) && c->geometry() != main->geometry())
c->setGeometry(main->geometry()); c->setGeometry(main->geometry());
if (states & Desktop) { if (states & Desktop) {