From 4b2c4ab109a770c9b424b24a66459fb2295e8771 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 26 Mar 2018 21:38:28 -0400 Subject: [PATCH] wayland: Don't emit signals if nothing changed We were emitting a preedit-changed even if the preedit text did not actually change, causing text views to scroll. --- gtk/gtkimcontextwayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c index af195581c8..5bb7ecd04d 100644 --- a/gtk/gtkimcontextwayland.c +++ b/gtk/gtkimcontextwayland.c @@ -84,6 +84,9 @@ static GtkIMContextWaylandGlobal *global = NULL; static void reset_preedit (GtkIMContextWayland *context) { + if (context->preedit.text == NULL) + return; + g_clear_pointer (&context->preedit.text, g_free); context->preedit.cursor_idx = 0; g_signal_emit_by_name (context, "preedit-changed"); -- 2.30.2