diff --git a/activation.cpp b/activation.cpp index 07a185fe80..bb829c321a 100644 --- a/activation.cpp +++ b/activation.cpp @@ -403,6 +403,7 @@ void Workspace::gotFocusIn( const Client* c ) // but didn't for some reason (and also won't anymore, because they were sooner) while( should_get_focus.first() != c ) should_get_focus.pop_front(); + should_get_focus.pop_front(); // remove 'c' } } diff --git a/events.cpp b/events.cpp index 2a184b2a29..c9aadb9a68 100644 --- a/events.cpp +++ b/events.cpp @@ -1309,6 +1309,8 @@ void Client::focusInEvent( XFocusInEvent* e ) return; // we don't care if ( e->detail == NotifyPointer ) return; // we don't care + if( !isShown( false ) || !isOnCurrentDesktop()) // we unmapped it, but it got focus meanwhile -> + return; // activateNextClient() already transferred focus elsewhere // check if this client is in should_get_focus list or if activation is allowed bool activate = workspace()->allowClientActivation( this, -1U, true ); workspace()->gotFocusIn( this ); // remove from should_get_focus list