Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
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 fd32ec1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/events/SDL_keyboard.c
Expand Up @@ -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;
Expand Down

0 comments on commit fd32ec1

Please sign in to comment.