GNOME Bugzilla – Bug 62948
Uncommitted text not committed on mnemonic activation
Last modified: 2016-05-24 11:31:38 UTC
If an entry or textview has uncommitted text from an input method and you perform a action that extracts the text without focusing out of the widget, then the uncommitted text will be missing. For example, bring up the file selection in testgtk select, as the input method "Cyrillic (translit)", click in the entry and type "ABC", then hit Alt-O to activate the OK buttton. The text that testgtk extracts from the filesel is "AB", not "ABC". Solutions to this include: - Make sure that any input method, including GtkIMContextSimple, that supports preedit, has a "commit" key. (Put the burden on the user.) - Add gtk_entry_commit_preedited_text() gtk_text_view_commit_preedited_text. (Put the burden on the programmer.) - Make the preedit text be returned by gtk_entry_get_text(); this works reasonably well, but I don't see how we can extend it to GtkTextView - the preedit text isn't part of the buffer so we can't make it visible to the programmer. - Make gtk_entry_get_text() do a gtk_im_context_reset() Bad, since getters like gtk_entry_get_text() shouldn't have a user visible effect. - Make mnemonic and accelerator activation send some sort of event to the currently focused widget to tell it to "finish" what it is doing, which would normally mean doing a gtk_im_context_reset(). Would we still have a problem with menu items activated through the mouse though, since we don't get a focus-out there? I don't like any of others, so I'm inclined to go low-tech and say we should just do the first solution,
*** Bug 91841 has been marked as a duplicate of this bug. ***
*** Bug 102176 has been marked as a duplicate of this bug. ***
*** Bug 107833 has been marked as a duplicate of this bug. ***
Adding keynav keyword.
Marking AP2 to reflect accessibility impact.
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs. Filter on "SUN A11Y SPAM" to ignore.
*** Bug 315374 has been marked as a duplicate of this bug. ***
Please don't put the burden on the user by requiring an explicit "commit" key. It would make many input methods much harder to use because of something that is ultimately a detail of the implementation. Wouldn't a better solution be to have any keypress (or user-initiated event such as buttonpress or menu item selection) not part of the IM sequence interrupt the sequence? I.e. Alt-O should cause "C" to be inserted in the buffer, just like return should in my example from bug 315374. That solution would pose no additional burden to either the programmer or the user, while maintaining the integrity of the getters.
Apologies for spam... ensuring Sun a11y folks are cc'ed on all current accessibility bugs.
as owen said back in 2001, lets declare this the input methods/users problem