gtktextview: Shuffle the places doing IM reset
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 17 Aug 2022 22:58:14 +0000 (00:58 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 18 Aug 2022 17:07:12 +0000 (19:07 +0200)
commit52ac71b9727b9a63773865309a970c4d97c0a75d
tree77bc1ff3bf8aaaa0485543115270b947b7c8e372
parent9e29739e6676bdb313aa19ce54c9da6c39cd4778
gtktextview: Shuffle the places doing IM reset

During text widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.

Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.

Also, fix a bug during GtkEventControllerKey::im-update where the condition
on cursor position editability to reset the IM context was inverted.
gtk/gtktextview.c