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--; } }