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: