mirror of
https://github.com/brl/mutter.git
synced 2025-03-16 00:05:08 +00:00

ClutterInputFocus/GtkIMContext uses char based offset for delete_surrounding, however, text_input_v3 uses byte based offset for it. Currently only GTK with mutter can work correctly via text_input_v3 because they both forget to convert between char based offset and byte based offset. This commit fixes it in mutter by saving committed surrounding text in MetaWaylandTextInput and converting char based offset to byte based offset with the UTF-8 encoded surrounding text. Fixes <https://gitlab.gnome.org/GNOME/mutter/-/issues/2146>. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2712>