From 6df34c13aa7d03445d676a1877abe4332f2518fc Mon Sep 17 00:00:00 2001 From: Chanwoong Kim Date: Thu, 3 Mar 2016 22:17:04 +0900 Subject: [PATCH 1/2] Fix a bug that IME did not disappeared after typing korean on osx --- src/platform/shared.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/shared.c b/src/platform/shared.c index 3c35dd975d..35828bdcc8 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -709,6 +709,10 @@ void platform_process_messages() gTextInputCompositionActive = ((e.edit.length != 0 || strlen(e.edit.text) != 0) && gTextInputComposition[0] != 0); break; case SDL_TEXTINPUT: + // will receive an `SDL_TEXTINPUT` event when a composition is committed. + // so, set gTextInputCompositionActive to false. + gTextInputCompositionActive = false; + if (gTextInputLength < gTextInputMaxLength && gTextInput){ // HACK ` will close console, so don't input any text if (e.text.text[0] == '`' && gConsoleOpen) From f05da9d31242a82c362b4bf9260927ab1c2847f9 Mon Sep 17 00:00:00 2001 From: Chanwoong Kim Date: Thu, 3 Mar 2016 22:28:31 +0900 Subject: [PATCH 2/2] Disactive IME when text input ends --- src/platform/shared.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/shared.c b/src/platform/shared.c index 35828bdcc8..b690730e28 100644 --- a/src/platform/shared.c +++ b/src/platform/shared.c @@ -873,6 +873,7 @@ void platform_stop_text_input() { SDL_StopTextInput(); gTextInput = NULL; + gTextInputCompositionActive = false; } static void platform_unload_cursors()