src/video/x11/SDL_x11events.c
changeset 6661 cd8befc0a969
parent 6660 4fa0723e6874
child 6774 ad8522052ce6
     1.1 --- a/src/video/x11/SDL_x11events.c	Wed Nov 07 08:49:59 2012 -0800
     1.2 +++ b/src/video/x11/SDL_x11events.c	Wed Nov 07 11:13:28 2012 -0800
     1.3 @@ -258,6 +258,13 @@
     1.4  #ifdef DEBUG_XEVENTS
     1.5              printf("window %p: FocusIn!\n", data);
     1.6  #endif
     1.7 +            if (data->pending_focus == PENDING_FOCUS_OUT &&
     1.8 +                data->window == SDL_GetKeyboardFocus()) {
     1.9 +                /* We want to reset the keyboard here, because we may have
    1.10 +                   missed keyboard messages after our previous FocusOut.
    1.11 +                 */
    1.12 +                SDL_ResetKeyboard();
    1.13 +            }
    1.14              data->pending_focus = PENDING_FOCUS_IN;
    1.15              data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_IN_TIME;
    1.16          }