Separate focus chains are nice, but KDE-style Alt+Tab not limited
to the current desktop still needs the global one for MRU (#124721). svn path=/trunk/KDE/kdebase/workspace/; revision=528612
This commit is contained in:
parent
7f04417ad5
commit
e906595aaf
4 changed files with 37 additions and 14 deletions
15
layers.cpp
15
layers.cpp
|
@ -431,6 +431,21 @@ void Workspace::restackClientUnderActive( Client* c )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// the same for global_focus_chain
|
||||||
|
if( c->wantsTabFocus() && global_focus_chain.contains( active_client ))
|
||||||
|
{
|
||||||
|
global_focus_chain.removeAll( c );
|
||||||
|
for ( int i = global_focus_chain.size() - 1;
|
||||||
|
i >= 0;
|
||||||
|
--i )
|
||||||
|
{
|
||||||
|
if( Client::belongToSameApplication( active_client, global_focus_chain.at( i ) ))
|
||||||
|
{
|
||||||
|
global_focus_chain.insert( i, c );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
updateStackingOrder();
|
updateStackingOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
26
tabbox.cpp
26
tabbox.cpp
|
@ -1165,14 +1165,13 @@ int Workspace::previousDesktopFocusChain( int iDesktop ) const
|
||||||
*/
|
*/
|
||||||
Client* Workspace::nextFocusChainClient( Client* c ) const
|
Client* Workspace::nextFocusChainClient( Client* c ) const
|
||||||
{
|
{
|
||||||
int desktop = !c || c->isOnAllDesktops() ? currentDesktop() : c->desktop();
|
if ( global_focus_chain.isEmpty() )
|
||||||
if ( focus_chain[desktop].isEmpty() )
|
|
||||||
return 0;
|
return 0;
|
||||||
ClientList::ConstIterator it = focus_chain[desktop].find( c );
|
ClientList::ConstIterator it = global_focus_chain.find( c );
|
||||||
if ( it == focus_chain[desktop].end() )
|
if ( it == global_focus_chain.end() )
|
||||||
return focus_chain[desktop].last();
|
return global_focus_chain.last();
|
||||||
if ( it == focus_chain[desktop].begin() )
|
if ( it == global_focus_chain.begin() )
|
||||||
return focus_chain[desktop].last();
|
return global_focus_chain.last();
|
||||||
--it;
|
--it;
|
||||||
return *it;
|
return *it;
|
||||||
}
|
}
|
||||||
|
@ -1183,15 +1182,14 @@ Client* Workspace::nextFocusChainClient( Client* c ) const
|
||||||
*/
|
*/
|
||||||
Client* Workspace::previousFocusChainClient( Client* c ) const
|
Client* Workspace::previousFocusChainClient( Client* c ) const
|
||||||
{
|
{
|
||||||
int desktop = !c || c->isOnAllDesktops() ? currentDesktop() : c->desktop();
|
if ( global_focus_chain.isEmpty() )
|
||||||
if ( focus_chain[desktop].isEmpty() )
|
|
||||||
return 0;
|
return 0;
|
||||||
ClientList::ConstIterator it = focus_chain[desktop].find( c );
|
ClientList::ConstIterator it = global_focus_chain.find( c );
|
||||||
if ( it == focus_chain[desktop].end() )
|
if ( it == global_focus_chain.end() )
|
||||||
return focus_chain[desktop].first();
|
return global_focus_chain.first();
|
||||||
++it;
|
++it;
|
||||||
if ( it == focus_chain[desktop].end() )
|
if ( it == global_focus_chain.end() )
|
||||||
return focus_chain[desktop].first();
|
return global_focus_chain.first();
|
||||||
return *it;
|
return *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -568,6 +568,7 @@ void Workspace::removeClient( Client* c, allowed_t )
|
||||||
i <= numberOfDesktops();
|
i <= numberOfDesktops();
|
||||||
++i )
|
++i )
|
||||||
focus_chain[ i ].remove( c );
|
focus_chain[ i ].remove( c );
|
||||||
|
global_focus_chain.remove( c );
|
||||||
attention_chain.remove( c );
|
attention_chain.remove( c );
|
||||||
if( c->isTopMenu())
|
if( c->isTopMenu())
|
||||||
removeTopMenu( c );
|
removeTopMenu( c );
|
||||||
|
@ -602,6 +603,7 @@ void Workspace::updateFocusChains( Client* c, bool make_first )
|
||||||
i<= numberOfDesktops();
|
i<= numberOfDesktops();
|
||||||
++i )
|
++i )
|
||||||
focus_chain[i].remove(c);
|
focus_chain[i].remove(c);
|
||||||
|
global_focus_chain.remove( c );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(c->desktop() == NET::OnAllDesktops)
|
if(c->desktop() == NET::OnAllDesktops)
|
||||||
|
@ -635,6 +637,13 @@ void Workspace::updateFocusChains( Client* c, bool make_first )
|
||||||
focus_chain[ i ].remove( c );
|
focus_chain[ i ].remove( c );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( make_first )
|
||||||
|
{
|
||||||
|
global_focus_chain.remove( c );
|
||||||
|
global_focus_chain.append( c );
|
||||||
|
}
|
||||||
|
else if( !global_focus_chain.contains( c ))
|
||||||
|
global_focus_chain.prepend( c );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::updateCurrentTopMenu()
|
void Workspace::updateCurrentTopMenu()
|
||||||
|
|
|
@ -510,6 +510,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
|
||||||
ClientList unconstrained_stacking_order;
|
ClientList unconstrained_stacking_order;
|
||||||
ClientList stacking_order;
|
ClientList stacking_order;
|
||||||
QVector< ClientList > focus_chain;
|
QVector< ClientList > focus_chain;
|
||||||
|
ClientList global_focus_chain; // this one is only for things like tabbox's MRU
|
||||||
ClientList should_get_focus; // last is most recent
|
ClientList should_get_focus; // last is most recent
|
||||||
ClientList attention_chain;
|
ClientList attention_chain;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue