[gtk/gtk-3-24: 6/9] gtkentry: Also reset IM context after IM surrounding text deletion
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 6/9] gtkentry: Also reset IM context after IM surrounding text deletion
- Date: Thu, 6 Oct 2022 10:57:36 +0000 (UTC)
commit 018083fab7fb588a5700540b1ee3ff3b5af6a0bd
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Sep 6 21:53:25 2022 +0200
gtkentry: 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.
gtk/gtkentry.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f8050df565..7da9f80796 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -6137,9 +6137,12 @@ gtk_entry_delete_surrounding_cb (GtkIMContext *slave,
GtkEntryPrivate *priv = entry->priv;
if (priv->editable)
- gtk_editable_delete_text (GTK_EDITABLE (entry),
- priv->current_pos + offset,
- priv->current_pos + offset + n_chars);
+ {
+ gtk_editable_delete_text (GTK_EDITABLE (entry),
+ priv->current_pos + offset,
+ priv->current_pos + offset + n_chars);
+ gtk_im_context_reset (slave);
+ }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]