Typing multi-byte characters on Accerciser's EditableText view leads to character duplication in it
@ban
Submitted by Colomban Wendling Link to original bug (#775481)
Description
Created attachment 341167 _SectionText: Fix caching insert event of multi-byte changes
To reproduce, type any multi-byte character (like "é") in Accerciser's view for an EditableText: that character then appears twice.
Attached is a pretty ugly patch fixing the issue. Improved implementation is welcome.
Patch description:
_SectionText: Fix caching insert event of multi-byte changes
The text view event reports the length in bytes, and apparently so does EditableText.insertText() despite what can be read. However, the accessibility event text-changed::insert reports a length in characters, in agreement with the documentation.
This leads to building mismatching cache entries, and thus not filtering events containing multi-byte characters.
Fix this the ugly way checking the cache against the length in bytes, as as mentioned above apparently the EditableText.insertText() call really want bytes (otherwise apps like Gtk.TextBuffer receive truncated data).
Patch 341167, "_SectionText: Fix caching insert event of multi-byte changes":
0001-_SectionText-Fix-caching-insert-event-of-multi-byte-.patch