backport r1214045: improve stack & focuschain activity checks

CCBUG: 262730

svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1214046
This commit is contained in:
Chani Armitage 2011-01-12 18:11:12 +00:00
parent 5d306bf4f0
commit 6bfeef78a6
4 changed files with 11 additions and 11 deletions

View file

@ -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;

View file

@ -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)

View file

@ -1619,7 +1619,7 @@ void Workspace::switchWindow( Direction direction )
for( QList<Client *>::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,

View file

@ -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 <V.Schatz at thphys.uni-heidelberg.de>)
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();