diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-09-06 21:55:13 +0200 |
---|---|---|
committer | msizanoen1 <msizanoen@qtmlabs.xyz> | 2022-10-06 17:29:50 +0700 |
commit | a88e848306acba018e2bd1c5d9c74bcf6e33eb7f (patch) | |
tree | 110a37b2f5d4e3ac50d7f4932c07b4d3424a2db6 | |
parent | 018083fab7fb588a5700540b1ee3ff3b5af6a0bd (diff) | |
download | gtk+-a88e848306acba018e2bd1c5d9c74bcf6e33eb7f.tar.gz |
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.
-rw-r--r-- | gtk/gtktextview.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 57dd199e2e..e6b4d0aa85 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -9240,8 +9240,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; } |