Skip to content

Commit

Permalink
x11: Fix spurious keyboard focus events
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegg0 committed Jun 17, 2020
1 parent 48989e2 commit f1d5ced
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -818,9 +818,9 @@ X11_DispatchEvent(_THIS)
break;
}

if (xevent.xfocus.detail == NotifyInferior) {
if (xevent.xfocus.detail == NotifyInferior || xevent.xfocus.detail == NotifyPointer) {
#ifdef DEBUG_XEVENTS
printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data);
printf("window %p: FocusIn (NotifyInferior/NotifyPointer, ignoring)\n", data);
#endif
break;
}
Expand Down Expand Up @@ -851,10 +851,12 @@ X11_DispatchEvent(_THIS)
#endif
break;
}
if (xevent.xfocus.detail == NotifyInferior) {
/* We still have focus if a child gets focus */
if (xevent.xfocus.detail == NotifyInferior || xevent.xfocus.detail == NotifyPointer) {
/* 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
printf("window %p: FocusOut (NotifierInferior, ignoring)\n", data);
printf("window %p: FocusOut (NotifyInferior/NotifyPointer, ignoring)\n", data);
#endif
break;
}
Expand Down

0 comments on commit f1d5ced

Please sign in to comment.