#62948, Uncommitted text not committed on mnemonic activation



Just noticed the following nasty:

  http://bugzilla.gnome.org/show_bug.cgi?id=62948

Ideas on better fixes appreciated,
                                        Owen

===

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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]