imcontextwayland: Ignore preedit updates from NULL to NULL
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 26 Apr 2022 10:23:09 +0000 (12:23 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 26 Apr 2022 10:23:09 +0000 (12:23 +0200)
If we get consecutive preedit string updates that announce a NULL
string, we still do end up issuing ::preedit-changed with those.
Ignore changes from NULL to NULL, it is the other combinations which
must issue this signal.

gtk/gtkimcontextwayland.c

index ea9ed00cfc53a1b21ab2d6b8dd4940ea42e8ffe0..069070509a0491968340b4cd587137f0f1a9d2a7 100644 (file)
@@ -174,6 +174,9 @@ text_input_preedit_apply (GtkIMContextWaylandGlobal *global)
     return;
 
   context = GTK_IM_CONTEXT_WAYLAND (global->current);
+  if (context->pending_preedit.text == NULL &&
+      context->current_preedit.text == NULL)
+    return;
 
   state_change = ((context->pending_preedit.text == NULL)
                  != (context->current_preedit.text == NULL));