Don't obscure windows that are not visible, otherwise switching between

two empty desktops can flicker.

svn path=/trunk/kdebase/kwin/; revision=263247
This commit is contained in:
Luboš Luňák 2003-10-30 17:22:06 +00:00
parent 240ad036d0
commit 323806acbe

View file

@ -935,23 +935,25 @@ bool Workspace::setCurrentDesktop( int new_desktop )
ObscuringWindows obs_wins; ObscuringWindows obs_wins;
int old_desktop = current_desktop;
current_desktop = new_desktop; // change the desktop (so that Client::virtualDesktopChange() works) current_desktop = new_desktop; // change the desktop (so that Client::virtualDesktopChange() works)
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it)
if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient ) if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient )
{ {
obs_wins.create( *it ); if( (*it)->isShown( true ) && (*it)->isOnDesktop( old_desktop ))
(*it)->virtualDesktopChange(); obs_wins.create( *it );
} (*it)->virtualDesktopChange();
}
rootInfo->setCurrentDesktop( current_desktop ); // now propagate the change, after hiding, before showing rootInfo->setCurrentDesktop( current_desktop ); // now propagate the change, after hiding, before showing
if( movingClient && !movingClient->isOnDesktop( new_desktop ))
movingClient->setDesktop( new_desktop );
for ( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it) for ( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it)
if ( (*it)->isOnDesktop( new_desktop ) ) if ( (*it)->isOnDesktop( new_desktop ) )
(*it)->virtualDesktopChange(); (*it)->virtualDesktopChange();
if( movingClient && !movingClient->isOnDesktop( new_desktop ))
movingClient->setDesktop( new_desktop );
} }
// restore the focus on this desktop // restore the focus on this desktop