From 53eefc6ed36e1dcf47a3d95119a170b3a0872088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 23 Feb 2004 17:09:47 +0000 Subject: [PATCH] Before getting event about focus being set to None, really check if it's still so before reseting it. Fixes problem with kview run from konsole, set to fullscreen, set back to normal, closed -> konsole doesn't become active. svn path=/trunk/kdebase/kwin/; revision=290622 --- events.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/events.cpp b/events.cpp index 65919451b1..1da4ddec1f 100644 --- a/events.cpp +++ b/events.cpp @@ -406,9 +406,15 @@ bool Workspace::workspaceEvent( XEvent * e ) case FocusIn: if( e->xfocus.window == rootWin() && e->xfocus.detail == NotifyDetailNone ) { - kdWarning( 1212 ) << "X focus set to None, reseting focus" << endl; - XSetInputFocus(qt_xdisplay(), null_focus_window, RevertToPointerRoot, CurrentTime ); - // focusToNull() uses qt_x_time, which is old now (FocusIn has no timestamp) + 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 ) + { + kdWarning( 1212 ) << "X focus set to None, reseting focus" << endl; + focusToNull(); + } } // fall through case FocusOut: