From 36a1cd4b18021b5ed8d689c416749099c0817f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 10 May 2004 14:06:32 +0000 Subject: [PATCH] Detect also X focus policy set to PointerRoot, and re-activate the active window instead of setting focus to null focus window. CCMAIL: 81145-done@bugs.kde.org svn path=/trunk/kdebase/kwin/; revision=310051 --- events.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/events.cpp b/events.cpp index 72c8b9016b..cde8d737c8 100644 --- a/events.cpp +++ b/events.cpp @@ -426,16 +426,20 @@ bool Workspace::workspaceEvent( XEvent * e ) return FALSE; break; case FocusIn: - if( e->xfocus.window == rootWin() && e->xfocus.detail == NotifyDetailNone ) + if( e->xfocus.window == rootWin() + && ( e->xfocus.detail == NotifyDetailNone || e->xfocus.detail == NotifyPointerRoot )) { updateXTime(); // focusToNull() uses qt_x_time, which is old now (FocusIn has no timestamp) Window focus; int revert; XGetInputFocus( qt_xdisplay(), &focus, &revert ); - if( focus == None ) + if( focus == None || focus == PointerRoot ) { - kdWarning( 1212 ) << "X focus set to None, reseting focus" << endl; - focusToNull(); + kdWarning( 1212 ) << "X focus set to None/PointerRoot, reseting focus" << endl; + if( mostRecentlyActivatedClient() != NULL ) + requestFocus( mostRecentlyActivatedClient(), true ); + else + focusToNull(); } } // fall through