Merging from old trunk:

r603050 | lunakl | 2006-11-07 18:07:24 +0100 (Tue, 07 Nov 2006) | 4 lines

Fix stacking order and focus chain when opening links in background
in Konqueror.


svn path=/trunk/KDE/kdebase/workspace/; revision=659304
This commit is contained in:
Luboš Luňák 2007-04-29 22:34:35 +00:00
parent 2e39d12ff6
commit bdabd3c2ee

View file

@ -404,8 +404,14 @@ void Workspace::restackClientUnderActive( Client* c )
return;
}
// put in the stacking order below _all_ windows belonging to the active application
assert( unconstrained_stacking_order.contains( active_client ));
if( Client::belongToSameApplication( active_client, c ))
{ // put it below the active window if it's the same app
unconstrained_stacking_order.removeAll( c );
unconstrained_stacking_order.insert( unconstrained_stacking_order.find( active_client ), c );
}
else
{ // put in the stacking order below _all_ windows belonging to the active application
for( ClientList::Iterator it = unconstrained_stacking_order.begin();
it != unconstrained_stacking_order.end();
++it )
@ -420,6 +426,7 @@ void Workspace::restackClientUnderActive( Client* c )
break;
}
}
}
assert( unconstrained_stacking_order.contains( c ));
for( int desktop = 1;
desktop <= numberOfDesktops();
@ -427,13 +434,19 @@ void Workspace::restackClientUnderActive( Client* c )
{ // do for every virtual desktop to handle the case of onalldesktop windows
if( c->wantsTabFocus() && c->isOnDesktop( desktop ) && focus_chain[ desktop ].contains( active_client ))
{
// also put in focus_chain[currentDesktop()] after all windows belonging to the active applicationa
if( Client::belongToSameApplication( active_client, c ))
{ // put it after the active window if it's the same app
focus_chain[ desktop ].removeAll( c );
for ( int i = focus_chain[ desktop ].size() - 1;
focus_chain[ desktop ].insert( focus_chain[ desktop ].find( active_client ), c );
}
else
{ // put it in focus_chain[currentDesktop()] after all windows belonging to the active applicationa
focus_chain[ desktop ].removeAll( c );
for( int i = focus_chain[ desktop ].size() - 1;
i >= 0;
--i )
{
if( Client::belongToSameApplication( active_client, focus_chain[ desktop ].at( i ) ))
if( Client::belongToSameApplication( active_client, focus_chain[ desktop ].at( i )))
{
focus_chain[ desktop ].insert( i, c );
break;
@ -441,8 +454,16 @@ void Workspace::restackClientUnderActive( Client* c )
}
}
}
}
// the same for global_focus_chain
if( c->wantsTabFocus() && global_focus_chain.contains( active_client ))
{
if( Client::belongToSameApplication( active_client, c ))
{
global_focus_chain.removeAll( c );
global_focus_chain.insert( global_focus_chain.find( active_client ), c );
}
else
{
global_focus_chain.removeAll( c );
for ( int i = global_focus_chain.size() - 1;
@ -456,6 +477,7 @@ void Workspace::restackClientUnderActive( Client* c )
}
}
}
}
updateStackingOrder();
}