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.
This commit is contained in:
Carlos Garnacho
2022-09-06 21:53:25 +02:00
committed by msizanoen1
parent fa6aca2925
commit 018083fab7

View File

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