From 323806acbea8987e002b4600b396534179d93851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 30 Oct 2003 17:22:06 +0000 Subject: [PATCH] Don't obscure windows that are not visible, otherwise switching between two empty desktops can flicker. svn path=/trunk/kdebase/kwin/; revision=263247 --- workspace.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 009ace3141..310a393d2d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -935,23 +935,25 @@ bool Workspace::setCurrentDesktop( int new_desktop ) ObscuringWindows obs_wins; + int old_desktop = current_desktop; current_desktop = new_desktop; // change the desktop (so that Client::virtualDesktopChange() works) for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) if ( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient ) - { - obs_wins.create( *it ); - (*it)->virtualDesktopChange(); - } + { + if( (*it)->isShown( true ) && (*it)->isOnDesktop( old_desktop )) + obs_wins.create( *it ); + (*it)->virtualDesktopChange(); + } 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) if ( (*it)->isOnDesktop( new_desktop ) ) (*it)->virtualDesktopChange(); - - if( movingClient && !movingClient->isOnDesktop( new_desktop )) - movingClient->setDesktop( new_desktop ); } // restore the focus on this desktop