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
icc-effect-5.14.5
Luboš Luňák 2004-02-23 17:09:47 +00:00
parent 339c7a297f
commit 53eefc6ed3
1 changed files with 9 additions and 3 deletions

View File

@ -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: