Explorar el Código

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 5962e5278c470e5f021c9b0e9178e0634968b337)
HolySkyMin hace 1 año
padre
commit
3dfb82f47b
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      platform/macos/display_server_macos.mm

+ 2 - 1
platform/macos/display_server_macos.mm

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