gtkentry: Avoid early IM reset on updates

Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.
This commit is contained in:
Carlos Garnacho
2022-09-06 21:38:35 +02:00
committed by msizanoen1
parent b0c4196f98
commit 7b1f9a3b08

View File

@@ -4897,7 +4897,7 @@ gtk_entry_key_press (GtkWidget *widget,
{
if (gtk_im_context_filter_keypress (priv->im_context, event))
{
gtk_im_context_reset (priv->im_context);
priv->need_im_reset = TRUE;
retval = TRUE;
goto out;
}
@@ -4939,7 +4939,7 @@ gtk_entry_key_release (GtkWidget *widget,
{
if (gtk_im_context_filter_keypress (priv->im_context, event))
{
gtk_im_context_reset (priv->im_context);
priv->need_im_reset = TRUE;
retval = TRUE;
goto out;
}
@@ -6082,7 +6082,10 @@ gtk_entry_commit_cb (GtkIMContext *context,
GtkEntryPrivate *priv = entry->priv;
if (priv->editable)
gtk_entry_enter_text (entry, str);
{
gtk_entry_enter_text (entry, str);
gtk_im_context_reset (context);
}
}
static void