Ensure compositions are committed when keyboard focus changes.
authordewyatt
Wed, 15 Sep 2010 00:28:19 -0400
changeset 4882e725a6a60c32
parent 4881 0972c2893e68
child 4883 511948f4919e
Ensure compositions are committed when keyboard focus changes.
There may be a better way to do this.
src/events/SDL_keyboard.c
     1.1 --- a/src/events/SDL_keyboard.c	Tue Sep 07 20:56:02 2010 -0700
     1.2 +++ b/src/events/SDL_keyboard.c	Wed Sep 15 00:28:19 2010 -0400
     1.3 @@ -612,6 +612,11 @@
     1.4      if (keyboard->focus && keyboard->focus != window) {
     1.5          SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
     1.6                              0, 0);
     1.7 +
     1.8 +        //Ensures IME compositions are committed
     1.9 +        if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
    1.10 +            SDL_GetVideoDevice()->StopTextInput(SDL_GetVideoDevice());
    1.11 +        }
    1.12      }
    1.13  
    1.14      keyboard->focus = window;