From 6bfeef78a680245489f48515b257bf4ee91d1dfa Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Wed, 12 Jan 2011 18:11:12 +0000 Subject: [PATCH] backport r1214045: improve stack & focuschain activity checks CCBUG: 262730 svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1214046 --- layers.cpp | 2 +- tabbox.cpp | 4 ++-- useractions.cpp | 2 +- workspace.cpp | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/layers.cpp b/layers.cpp index 143e79be93..3c0066264c 100644 --- a/layers.cpp +++ b/layers.cpp @@ -263,7 +263,7 @@ Client* Workspace::topClientOnDesktop( int desktop, int screen, bool unconstrain i >= 0; --i ) { - if( list.at( i )->isOnDesktop( desktop ) && list.at( i )->isShown( false )) + if( list.at( i )->isOnDesktop( desktop ) && list.at( i )->isShown( false ) && list.at(i)->isOnCurrentActivity()) { if( screen != -1 && list.at( i )->screen() != screen ) continue; diff --git a/tabbox.cpp b/tabbox.cpp index e2e081884e..f66ce2b707 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -977,7 +977,7 @@ void Workspace::CDEWalkThroughWindows( bool forward ) --i ) { Client* it = stacking_order.at( i ); - if ( it->isOnCurrentDesktop() && !it->isSpecialWindow() + if ( it->isOnCurrentActivity() && it->isOnCurrentDesktop() && !it->isSpecialWindow() && it->isShown( false ) && it->wantsTabFocus() && !it->keepAbove() && !it->keepBelow()) { @@ -1010,7 +1010,7 @@ void Workspace::CDEWalkThroughWindows( bool forward ) } } while (nc && nc != c && (( !options_traverse_all && !nc->isOnDesktop(currentDesktop())) || - nc->isMinimized() || !nc->wantsTabFocus() || nc->keepAbove() || nc->keepBelow() ) ); + nc->isMinimized() || !nc->wantsTabFocus() || nc->keepAbove() || nc->keepBelow() || !nc->isOnCurrentActivity() ) ); if (nc) { if (c && c != nc) diff --git a/useractions.cpp b/useractions.cpp index 60274cd0bb..1f23fe98c9 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -1619,7 +1619,7 @@ void Workspace::switchWindow( Direction direction ) for( QList::Iterator i = clist.begin(); i != clist.end(); ++i ) { if( (*i)->wantsTabFocus() && *i != c && - (*i)->desktop() == d && ! (*i)->isMinimized() ) + (*i)->desktop() == d && ! (*i)->isMinimized() && (*i)->isOnCurrentActivity() ) { // Centre of the other window QPoint other( (*i)->pos().x() + (*i)->geometry().width() / 2, diff --git a/workspace.cpp b/workspace.cpp index 3344b5e48d..b124df69ff 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1453,7 +1453,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) for( ClientList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it ) - if( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient ) + if( !(*it)->isOnDesktop( new_desktop ) && (*it) != movingClient && (*it)->isOnCurrentActivity() ) { if( (*it)->isShown( true ) && (*it)->isOnDesktop( old_desktop )) obs_wins.create( *it ); @@ -1477,7 +1477,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) } for( int i = stacking_order.size() - 1; i >= 0 ; --i ) - if( stacking_order.at( i )->isOnDesktop( new_desktop )) + if( stacking_order.at( i )->isOnDesktop( new_desktop ) && stacking_order.at( i )->isOnCurrentActivity()) stacking_order.at( i )->updateVisibility(); --block_showing_desktop; @@ -1500,7 +1500,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) for( int i = focus_chain[currentDesktop()].size() - 1; i >= 0; --i ) { if( focus_chain[currentDesktop()].at( i )->isShown( false ) && - focus_chain[currentDesktop()].at( i )->isOnCurrentDesktop() ) + focus_chain[currentDesktop()].at( i )->isOnCurrentActivity() ) { c = focus_chain[currentDesktop()].at( i ); break; @@ -1585,7 +1585,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) for( ClientList::ConstIterator it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it ) - if( !(*it)->isOnActivity( new_activity ) && (*it) != movingClient ) + if( !(*it)->isOnActivity( new_activity ) && (*it) != movingClient && (*it)->isOnCurrentDesktop()) { if( (*it)->isShown( true ) && (*it)->isOnActivity( old_activity )) obs_wins.create( *it ); @@ -1633,7 +1633,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) for( int i = focus_chain[currentDesktop()].size() - 1; i >= 0; --i ) { if( focus_chain[currentDesktop()].at( i )->isShown( false ) && - focus_chain[currentDesktop()].at( i )->isOnCurrentDesktop() ) + focus_chain[currentDesktop()].at( i )->isOnCurrentActivity() ) { c = focus_chain[currentDesktop()].at( i ); break; @@ -1644,7 +1644,7 @@ void Workspace::updateCurrentActivity(const QString &new_activity) // If "unreasonable focus policy" and active_client is on_all_desktops and // under mouse (Hence == old_active_client), conserve focus. // (Thanks to Volker Schatz ) - else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop() ) + else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop() && active_client->isOnCurrentActivity() ) c = active_client; if( c == NULL && !desktops.isEmpty() ) @@ -2927,7 +2927,7 @@ void Workspace::setShowingDesktop( bool showing ) for( ClientList::ConstIterator it = cls.constBegin(); it != cls.constEnd(); ++it ) - if( (*it)->isOnCurrentDesktop() && (*it)->isShown( true ) && !(*it)->isSpecialWindow() ) + if( (*it)->isOnCurrentActivity() && (*it)->isOnCurrentDesktop() && (*it)->isShown( true ) && !(*it)->isSpecialWindow() ) showing_desktop_clients.prepend( *it ); // Topmost first to reduce flicker for( ClientList::ConstIterator it = showing_desktop_clients.constBegin(); it != showing_desktop_clients.constEnd();