From 5962e5278c470e5f021c9b0e9178e0634968b337 Mon Sep 17 00:00:00 2001 From: HolySkyMin Date: Tue, 28 Nov 2023 17:20:33 +0900 Subject: [PATCH] Fix IME key event being erased in macOS Fixes Korean IME behavior which calls insertText and setMarkedText at the same time. --- platform/macos/display_server_macos.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 2a6f17cb5d5f..407a3158277d 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -725,7 +725,8 @@ } void DisplayServerMacOS::pop_last_key_event() { - if (key_event_pos > 0) { + // Does not pop last key event when it is an IME key event. + if (key_event_pos > 0 && key_event_buffer[key_event_pos - 1].raw) { key_event_pos--; } }