Don't lose focus if a child window gains focus
authorSam Lantinga <slouken@libsdl.org>
Wed, 07 Nov 2012 08:49:59 -0800
changeset 66604fa0723e6874
parent 6659 4016ef96095a
child 6661 cd8befc0a969
Don't lose focus if a child window gains focus
src/video/x11/SDL_x11events.c
     1.1 --- a/src/video/x11/SDL_x11events.c	Tue Nov 06 10:34:47 2012 -0800
     1.2 +++ b/src/video/x11/SDL_x11events.c	Wed Nov 07 08:49:59 2012 -0800
     1.3 @@ -249,6 +249,12 @@
     1.4  
     1.5          /* Gaining input focus? */
     1.6      case FocusIn:{
     1.7 +            if (xevent.xfocus.detail == NotifyInferior) {
     1.8 +#ifdef DEBUG_XEVENTS
     1.9 +                printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data);
    1.10 +#endif
    1.11 +                break;
    1.12 +            }
    1.13  #ifdef DEBUG_XEVENTS
    1.14              printf("window %p: FocusIn!\n", data);
    1.15  #endif
    1.16 @@ -259,6 +265,13 @@
    1.17  
    1.18          /* Losing input focus? */
    1.19      case FocusOut:{
    1.20 +            if (xevent.xfocus.detail == NotifyInferior) {
    1.21 +                /* We still have focus if a child gets focus */
    1.22 +#ifdef DEBUG_XEVENTS
    1.23 +                printf("window %p: FocusOut (NotifierInferior, ignoring)\n", data);
    1.24 +#endif
    1.25 +                break;
    1.26 +            }
    1.27  #ifdef DEBUG_XEVENTS
    1.28              printf("window %p: FocusOut!\n", data);
    1.29  #endif