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.
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;
}