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.
This commit is contained in:
Carlos Garnacho 2022-09-06 21:55:13 +02:00 committed by Mat
parent 735f803c2f
commit 1a459c5dcd

View File

@ -8687,8 +8687,9 @@ gtk_text_view_delete_surrounding_handler (GtkIMContext *context,
gtk_text_iter_forward_chars (&start, offset); gtk_text_iter_forward_chars (&start, offset);
gtk_text_iter_forward_chars (&end, offset + n_chars); gtk_text_iter_forward_chars (&end, offset + n_chars);
gtk_text_buffer_delete_interactive (priv->buffer, &start, &end, if (gtk_text_buffer_delete_interactive (priv->buffer, &start, &end,
priv->editable); priv->editable))
gtk_im_context_reset (context);
return TRUE; return TRUE;
} }