diff --git a/activation.cpp b/activation.cpp index 49167b77f4..70fe5e9db9 100644 --- a/activation.cpp +++ b/activation.cpp @@ -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, // or when no window is currently active // 4 - extreme - no window gets focus without user intervention + if( time == -1U ) + time = c->userTime(); if( session_saving && options->focusStealingPreventionLevel <= 3 ) // <= normal { diff --git a/events.cpp b/events.cpp index 4245487bc2..ec4af720e9 100644 --- a/events.cpp +++ b/events.cpp @@ -108,6 +108,8 @@ void RootInfo::changeActiveWindow( Window w, NET::RequestSource src, Time timest { if( Client* c = workspace->findClient( WindowMatchPredicate( w ))) { + if( timestamp == CurrentTime ) + timestamp = c->userTime(); if( src == NET::FromUnknown ) src = NET::FromTool; // KWIN_FOCUS, use qt_x_time as timestamp? 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 else if( active_window != None && ( 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 ); else c->demandAttention();