Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Ensure compositions are committed when keyboard focus changes.

There may be a better way to do this.
  • Loading branch information
dewyatt committed Sep 15, 2010
1 parent 0b6f47b commit fd32ec12d56be6e6e1470e1d3bf93cc6d4133c3c
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/events/SDL_keyboard.c
@@ -612,6 +612,11 @@ SDL_SetKeyboardFocus(SDL_Window * window)
if (keyboard->focus && keyboard->focus != window) {
SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
0, 0);

//Ensures IME compositions are committed
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
SDL_GetVideoDevice()->StopTextInput(SDL_GetVideoDevice());
}
}

keyboard->focus = window;

0 comments on commit fd32ec1

Please sign in to comment.