x11: Fix spurious keyboard focus events

This commit is contained in:
James Legg 2020-06-17 12:48:40 +01:00
parent 48989e2a87
commit f1d5ced167
1 changed files with 7 additions and 5 deletions

View File

@ -818,9 +818,9 @@ X11_DispatchEvent(_THIS)
break; break;
} }
if (xevent.xfocus.detail == NotifyInferior) { if (xevent.xfocus.detail == NotifyInferior || xevent.xfocus.detail == NotifyPointer) {
#ifdef DEBUG_XEVENTS #ifdef DEBUG_XEVENTS
printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data); printf("window %p: FocusIn (NotifyInferior/NotifyPointer, ignoring)\n", data);
#endif #endif
break; break;
} }
@ -851,10 +851,12 @@ X11_DispatchEvent(_THIS)
#endif #endif
break; break;
} }
if (xevent.xfocus.detail == NotifyInferior) { if (xevent.xfocus.detail == NotifyInferior || xevent.xfocus.detail == NotifyPointer) {
/* We still have focus if a child gets focus */ /* We still have focus if a child gets focus. We also don't
care about the position of the pointer when the keyboard
focus changed. */
#ifdef DEBUG_XEVENTS #ifdef DEBUG_XEVENTS
printf("window %p: FocusOut (NotifierInferior, ignoring)\n", data); printf("window %p: FocusOut (NotifyInferior/NotifyPointer, ignoring)\n", data);
#endif #endif
break; break;
} }