From: Carlos Garnacho Date: Tue, 6 Sep 2022 19:53:25 +0000 (+0200) Subject: gtktext: 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~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7c0a395ff9443ad4d59fa50c64962b204f4c0e62;p=gtk4.git gtktext: 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/gtktext.c b/gtk/gtktext.c index 5fbc3e95fe..796683e44e 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -4298,9 +4298,12 @@ gtk_text_delete_surrounding_cb (GtkIMContext *context, GtkTextPrivate *priv = gtk_text_get_instance_private (self); if (priv->editable) - gtk_editable_delete_text (GTK_EDITABLE (self), - priv->current_pos + offset, - priv->current_pos + offset + n_chars); + { + gtk_editable_delete_text (GTK_EDITABLE (self), + priv->current_pos + offset, + priv->current_pos + offset + n_chars); + gtk_im_context_reset (context); + } return TRUE; }