Added shadeMode synchronization between client and target when attempting to add a client to a group. Triggers target decoration repaint when adding the client

to the group fails, in order to make sure that hove animations are reset properly.
BUG: 223726

svn path=/trunk/KDE/kdebase/workspace/; revision=1081273
This commit is contained in:
Hugo Pereira Da Costa 2010-01-28 03:23:09 +00:00
parent 7c284cb3e1
commit 3027731686

View file

@ -64,13 +64,28 @@ void ClientGroup::add( Client* c, int before, bool becomeVisible )
// If it's not possible to have the same states then ungroup them, TODO: Check all states // If it's not possible to have the same states then ungroup them, TODO: Check all states
// We do this here as the ungroup code in updateStates() cannot be called until add() completes // We do this here as the ungroup code in updateStates() cannot be called until add() completes
ShadeMode oldShadeMode = c->shadeMode();
if( c->shadeMode() != clients_[visible_]->shadeMode() )
c->setShade( clients_[visible_]->shadeMode() );
if( c->shadeMode() != clients_[visible_]->shadeMode() )
{
if( oldGroup ) // Re-add to old group if required
c->setClientGroup( oldGroup );
// One need to trigger decoration repaint on the group to
// make sure hover animations are properly reset.
clients_[visible_]->triggerDecorationRepaint();
return;
}
QRect oldGeom = c->geometry(); QRect oldGeom = c->geometry();
if( c->geometry() != clients_[visible_]->geometry() ) if( c->geometry() != clients_[visible_]->geometry() )
c->setGeometry( clients_[visible_]->geometry() ); c->setGeometry( clients_[visible_]->geometry() );
if( c->geometry() != clients_[visible_]->geometry() ) if( c->geometry() != clients_[visible_]->geometry() )
{ {
if( c->shadeMode() != oldShadeMode )
c->setShade( oldShadeMode ); // Restore old shade mode
if( oldGroup ) // Re-add to old group if required if( oldGroup ) // Re-add to old group if required
c->setClientGroup( oldGroup ); c->setClientGroup( oldGroup );
clients_[visible_]->triggerDecorationRepaint();
return; return;
} }
if( c->desktop() != clients_[visible_]->desktop() ) if( c->desktop() != clients_[visible_]->desktop() )
@ -79,8 +94,11 @@ void ClientGroup::add( Client* c, int before, bool becomeVisible )
{ {
if( c->geometry() != oldGeom ) if( c->geometry() != oldGeom )
c->setGeometry( oldGeom ); // Restore old geometry c->setGeometry( oldGeom ); // Restore old geometry
if( c->shadeMode() != oldShadeMode )
c->setShade( oldShadeMode ); // Restore old shade mode
if( oldGroup ) // Re-add to old group if required if( oldGroup ) // Re-add to old group if required
c->setClientGroup( oldGroup ); c->setClientGroup( oldGroup );
clients_[visible_]->triggerDecorationRepaint();
return; return;
} }