If an application is refused to be raised, but it's above the active client
for some reason, don't restack it below the active one as a result of its requrest to be raised. svn path=/trunk/kdebase/kwin/; revision=270832
This commit is contained in:
parent
0b8ee9a5e4
commit
6d7e93267d
1 changed files with 11 additions and 3 deletions
14
layers.cpp
14
layers.cpp
|
@ -332,20 +332,28 @@ void Workspace::raiseClientWithinApplication( Client* c )
|
||||||
StackingUpdatesBlocker blocker( this );
|
StackingUpdatesBlocker blocker( this );
|
||||||
// ignore mainwindows
|
// ignore mainwindows
|
||||||
|
|
||||||
unconstrained_stacking_order.remove( c );
|
|
||||||
bool raised = false;
|
bool raised = false;
|
||||||
|
bool is_above_active = false;
|
||||||
|
bool was_active = false;
|
||||||
// first try to put it above the top-most window of the application
|
// first try to put it above the top-most window of the application
|
||||||
for( ClientList::Iterator it = unconstrained_stacking_order.fromLast();
|
for( ClientList::Iterator it = unconstrained_stacking_order.fromLast();
|
||||||
it != unconstrained_stacking_order.end();
|
it != unconstrained_stacking_order.end();
|
||||||
--it )
|
--it )
|
||||||
if( Client::belongToSameApplication( *it, c ))
|
{
|
||||||
|
if( (*it)->isActive())
|
||||||
|
was_active = true;
|
||||||
|
if( Client::belongToSameApplication( *it, c ) && (*it) != c )
|
||||||
{
|
{
|
||||||
|
unconstrained_stacking_order.remove( c );
|
||||||
++it; // insert after the found one
|
++it; // insert after the found one
|
||||||
unconstrained_stacking_order.insert( it, c );
|
unconstrained_stacking_order.insert( it, c );
|
||||||
raised = true;
|
raised = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( !raised )
|
if( *it == c && !was_active ) // if it is already above the active one for some reason,
|
||||||
|
is_above_active = true; // don't put it lower just because it asked to be raised
|
||||||
|
}
|
||||||
|
if( !raised && !is_above_active )
|
||||||
restackClientUnderActive( c );
|
restackClientUnderActive( c );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue