macOS: Explicitly cancel IME composition when losing the focus
This commit is contained in:
parent
d1531632a2
commit
a3aaaa1efb
@ -709,6 +709,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
_glfwInputWindowFocus(window, false);
|
_glfwInputWindowFocus(window, false);
|
||||||
// IME is cancelled when losing the focus
|
// IME is cancelled when losing the focus
|
||||||
if ([window->ns.view hasMarkedText]) {
|
if ([window->ns.view hasMarkedText]) {
|
||||||
|
[[window->ns.view inputContext] discardMarkedText];
|
||||||
[window->ns.view unmarkText];
|
[window->ns.view unmarkText];
|
||||||
GLFWkeyevent dummy = {.action = GLFW_RELEASE, .ime_state = GLFW_IME_PREEDIT_CHANGED};
|
GLFWkeyevent dummy = {.action = GLFW_RELEASE, .ime_state = GLFW_IME_PREEDIT_CHANGED};
|
||||||
_glfwInputKeyboard(window, &dummy);
|
_glfwInputKeyboard(window, &dummy);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user