Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't lose focus if a child window gains focus
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 7, 2012
1 parent ceff0a1 commit ced78c6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -249,6 +249,12 @@ X11_DispatchEvent(_THIS)

/* Gaining input focus? */
case FocusIn:{
if (xevent.xfocus.detail == NotifyInferior) {
#ifdef DEBUG_XEVENTS
printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data);
#endif
break;
}
#ifdef DEBUG_XEVENTS
printf("window %p: FocusIn!\n", data);
#endif
Expand All @@ -259,6 +265,13 @@ X11_DispatchEvent(_THIS)

/* Losing input focus? */
case FocusOut:{
if (xevent.xfocus.detail == NotifyInferior) {
/* We still have focus if a child gets focus */
#ifdef DEBUG_XEVENTS
printf("window %p: FocusOut (NotifierInferior, ignoring)\n", data);
#endif
break;
}
#ifdef DEBUG_XEVENTS
printf("window %p: FocusOut!\n", data);
#endif
Expand Down

0 comments on commit ced78c6

Please sign in to comment.