From: Carlos Garnacho Date: Tue, 6 Sep 2022 19:55:13 +0000 (+0200) Subject: gtktextview: Also reset IM context after IM surrounding text deletion X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~2^2~21^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5b78fe2721222fabbff245e6249cc8fe89957f1a;p=gtk4.git gtktextview: Also reset IM context after IM surrounding text deletion When the IM commands the GtkText to delete text, the cursor position would change, and so would the surrounding text. Reset the IM context so that these updates are properly picked up by the IM. Fixes backspace key behavior in the GNOME Shell OSK, since that relies on the surrounding text being properly updated for the next iteration. --- diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 1684b3288e..2e600e01bb 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -8695,8 +8695,9 @@ gtk_text_view_delete_surrounding_handler (GtkIMContext *context, gtk_text_iter_forward_chars (&start, offset); gtk_text_iter_forward_chars (&end, offset + n_chars); - gtk_text_buffer_delete_interactive (priv->buffer, &start, &end, - priv->editable); + if (gtk_text_buffer_delete_interactive (priv->buffer, &start, &end, + priv->editable)) + gtk_im_context_reset (context); return TRUE; }