mirror of
https://github.com/yawut/SDL.git
synced 2026-07-22 02:41:13 -05:00
Ensure compositions are committed when keyboard focus changes.
There may be a better way to do this.
This commit is contained in:
parent
c366d9cf51
commit
0723b1ef98
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user