Fix IME key event being erased in macOS

Fixes Korean IME behavior which calls insertText and setMarkedText at the same time.

(cherry picked from commit 5962e5278c)
This commit is contained in:
HolySkyMin 2023-11-28 17:20:33 +09:00 committed by Rémi Verschelde
parent 2b3a8f060a
commit 3dfb82f47b
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -725,7 +725,8 @@ void DisplayServerMacOS::update_mouse_pos(DisplayServerMacOS::WindowData &p_wd,
}
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--;
}
}