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
This commit is contained in:
Luboš Luňák 2004-05-10 14:06:32 +00:00
parent 568b06087b
commit 36a1cd4b18

View file

@ -426,15 +426,19 @@ bool Workspace::workspaceEvent( XEvent * e )
return FALSE; return FALSE;
break; break;
case FocusIn: 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) updateXTime(); // focusToNull() uses qt_x_time, which is old now (FocusIn has no timestamp)
Window focus; Window focus;
int revert; int revert;
XGetInputFocus( qt_xdisplay(), &focus, &revert ); XGetInputFocus( qt_xdisplay(), &focus, &revert );
if( focus == None ) if( focus == None || focus == PointerRoot )
{ {
kdWarning( 1212 ) << "X focus set to None, reseting focus" << endl; kdWarning( 1212 ) << "X focus set to None/PointerRoot, reseting focus" << endl;
if( mostRecentlyActivatedClient() != NULL )
requestFocus( mostRecentlyActivatedClient(), true );
else
focusToNull(); focusToNull();
} }
} }