GNOME Bugzilla – Bug 731429
Incorrect text provided by AtkText text-insert signal for GtkEntry
Last modified: 2014-06-09 23:16:30 UTC
Created attachment 278164 [details] accessible-event listener Steps to reproduce: 1. Launch one of gtk3-demo's Entry demos 2. Launch the attached accessible-event listener in a terminal 3. In the entry type "ab" 4. Press Home to move to the beginning, then type "cd" Expected results: The newly-inserted character would be provided as the accessible event's any_data (see below for output). Actual results: Whatever character (if any) is at the insertion point is provided as the accessible event's any_data (see below for output). Notes: 1. This is a regression, but I've gone back and it is present in at least 3.8.0. Not sure when it was introduced wrt Gtk+ 3. But it is not present in Gtk+ 2. 2. This issue is not present for GtkTextView; just GtkEntry. Expected results / Gtk+ 2 results: ================================== object:text-changed:insert(0, 1, a) source: [text | ] host_application: [application | gtk-demo] object:text-changed:insert(1, 1, b) source: [text | ] host_application: [application | gtk-demo] object:text-changed:insert(0, 1, c) source: [text | ] host_application: [application | gtk-demo] object:text-changed:insert(1, 1, d) source: [text | ] host_application: [application | gtk-demo] Actual results / Gtk+ 3 results: ================================ object:text-changed:insert(0, 1, ) <-- "a" missing source: [text | ] host_application: [application | gtk3-demo] object:text-changed:insert(1, 1, ) <-- "b" missing source: [text | ] host_application: [application | gtk3-demo] object:text-changed:insert(0, 1, a) <-- should be "c"; not "a" source: [text | ] host_application: [application | gtk3-demo] object:text-changed:insert(1, 1, a) <-- should be "d"; not "a" source: [text | ] host_application: [application | gtk3-demo]
Created attachment 278168 [details] [review] Adjust position to reflect offset of insertion; not current offset After a quick chat with Benjamin, I took a look at what happens for GtkTextViewAccessible. Doing the same thing for GtkEntryAccessible appears to solve the problem.
I pushed the fix to master and the gtk-3-12 branch.