src/video/x11/SDL_x11events.c
changeset 7902 0c2e2b91eeea
parent 7885 a8bd63b33636
child 7942 a1c4c17410e8
     1.1 --- a/src/video/x11/SDL_x11events.c	Sun Nov 03 09:42:23 2013 -0800
     1.2 +++ b/src/video/x11/SDL_x11events.c	Sun Nov 03 09:55:27 2013 -0800
     1.3 @@ -245,7 +245,13 @@
     1.4  #ifdef DEBUG_XEVENTS
     1.5      printf("window %p: Dispatching FocusOut\n", data);
     1.6  #endif
     1.7 -    SDL_SetKeyboardFocus(NULL);
     1.8 +    /* If another window has already processed a focus in, then don't try to
     1.9 +     * remove focus here.  Doing so will incorrectly remove focus from that
    1.10 +     * window, and the focus lost event for this window will have already
    1.11 +     * been dispatched anyway. */
    1.12 +    if (data->window == SDL_GetKeyboardFocus()) {
    1.13 +        SDL_SetKeyboardFocus(NULL);
    1.14 +    }
    1.15  #ifdef X_HAVE_UTF8_STRING
    1.16      if (data->ic) {
    1.17          X11_XUnsetICFocus(data->ic);