gtktext: Avoid early IM reset on updates
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 6 Sep 2022 19:43:14 +0000 (21:43 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 6 Sep 2022 20:17:40 +0000 (22:17 +0200)
commit41f26975a99f3f66db41c5c8c08f6d220a3534d2
tree138b824758b418c016eb940a4a14c2f3b027b3b5
parent085374198fdf6a66e5cadd4dd07cca79e5243839
gtktext: 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.

Since there is going to be an actual IM reset anyways, it does
no longer make sense to try to preserve the old priv->need_im_reset
status during commit handling.

Fixes: 52ac71b972 ("gtktextview: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
gtk/gtktext.c
gtk/gtktextview.c