Fix some focus stealing prevention problems when timestamp is not
explicitly specified. svn path=/trunk/kdebase/kwin/; revision=293135
This commit is contained in:
parent
648fb3ed22
commit
aa8f2d6607
2 changed files with 6 additions and 1 deletions
|
@ -419,6 +419,8 @@ bool Workspace::allowClientActivation( const Client* c, Time time, bool focus_in
|
||||||
// 3 - high - new window gets focus only if it belongs to the active application,
|
// 3 - high - new window gets focus only if it belongs to the active application,
|
||||||
// or when no window is currently active
|
// or when no window is currently active
|
||||||
// 4 - extreme - no window gets focus without user intervention
|
// 4 - extreme - no window gets focus without user intervention
|
||||||
|
if( time == -1U )
|
||||||
|
time = c->userTime();
|
||||||
if( session_saving
|
if( session_saving
|
||||||
&& options->focusStealingPreventionLevel <= 3 ) // <= normal
|
&& options->focusStealingPreventionLevel <= 3 ) // <= normal
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,6 +108,8 @@ void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timest
|
||||||
{
|
{
|
||||||
if( Client* c = workspace->findClient( WindowMatchPredicate( w )))
|
if( Client* c = workspace->findClient( WindowMatchPredicate( w )))
|
||||||
{
|
{
|
||||||
|
if( timestamp == CurrentTime )
|
||||||
|
timestamp = c->userTime();
|
||||||
if( src == NET::FromUnknown )
|
if( src == NET::FromUnknown )
|
||||||
src = NET::FromTool; // KWIN_FOCUS, use qt_x_time as timestamp?
|
src = NET::FromTool; // KWIN_FOCUS, use qt_x_time as timestamp?
|
||||||
if( src == NET::FromTool )
|
if( src == NET::FromTool )
|
||||||
|
@ -120,7 +122,8 @@ void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timest
|
||||||
// if activation of the requestor's window would be allowed, allow activation too
|
// if activation of the requestor's window would be allowed, allow activation too
|
||||||
else if( active_window != None
|
else if( active_window != None
|
||||||
&& ( c2 = workspace->findClient( WindowMatchPredicate( active_window ))) != NULL
|
&& ( c2 = workspace->findClient( WindowMatchPredicate( active_window ))) != NULL
|
||||||
&& workspace->allowClientActivation( c2, timestamp ))
|
&& workspace->allowClientActivation( c2,
|
||||||
|
timestampCompare( timestamp, c2->userTime() > 0 ? timestamp : c2->userTime())))
|
||||||
workspace->activateClient( c );
|
workspace->activateClient( c );
|
||||||
else
|
else
|
||||||
c->demandAttention();
|
c->demandAttention();
|
||||||
|
|
Loading…
Reference in a new issue