소스 검색

[Wayland] Fix excessive IME updates.

Pāvels Nadtočajevs 9 달 전
부모
커밋
133ea4f17a
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      platform/linuxbsd/wayland/display_server_wayland.cpp

+ 5 - 3
platform/linuxbsd/wayland/display_server_wayland.cpp

@@ -1223,10 +1223,12 @@ void DisplayServerWayland::process_events() {
 
 
 		Ref<WaylandThread::IMEUpdateEventMessage> ime_update_msg = msg;
 		Ref<WaylandThread::IMEUpdateEventMessage> ime_update_msg = msg;
 		if (ime_update_msg.is_valid()) {
 		if (ime_update_msg.is_valid()) {
-			ime_text = ime_update_msg->text;
-			ime_selection = ime_update_msg->selection;
+			if (ime_text != ime_update_msg->text || ime_selection != ime_update_msg->selection) {
+				ime_text = ime_update_msg->text;
+				ime_selection = ime_update_msg->selection;
 
 
-			OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
+				OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
+			}
 		}
 		}
 	}
 	}