From a6adcb9056339140fa73b0d4be8b9839240bbc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 11 Mar 2004 13:15:04 +0000 Subject: [PATCH] Ignore FocusIn events for clients which were unmapped by kwin but had got focus shortly before. Otherwise quick switching between two virtual desktops with Konsoles can result in demand attention state. svn path=/trunk/kdebase/kwin/; revision=295169 --- activation.cpp | 1 + events.cpp | 2 ++ 2 files changed, 3 insertions(+) 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