GNOME Bugzilla – Bug 684511
Gnumeric wrongly clear the cell while preedit changes.
Last modified: 2012-09-23 02:04:54 UTC
Created attachment 224880 [details] patch for fixing this while preedit change the text should still be kept even if it began edit, clear the text will cause some unintend data loss, please check the patch. Related report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687729
Created attachment 224884 [details] [review] Use imcontext's preedit-start/end to avoid unwanted preedit-change. Use imcontext's preedit-start/end to avoid unwanted preedit-change. This seems to be far better than use im_block_start_edit hack, need to be polished.
As long as we can verify that this doesn't affect people using the default input method, I think something like this can go in. I really wish there was some authoritative documentation on this stuff.
Since "start/end" is maintained in GtkIMContext itself, I'm not sure whether gnumeric want to still to keep some "block" (init and finalize or some special case that I don't know), that's why I mentioned need to be polished, but code used to "wrap-up" reset is quite ugly and useless. I'm developer of fcitx and also I have read related ibus code throughly. Well, as from fcitx and ibus code, preedit-start and end will always appear in pairs. Other built-in im module in GTK don't even use preedit. So they will not be affected. Another comments is, I think the "if (is_editing)" in preedit-changed callback will never run after this change, I just leave it there if anything bad happens by chance.
There does not seem to be any real documentation for correct use of the "preedit-*" signals. So I don't think it should really be used. (We see enough changes breaking documented interfaces so that using a non-documented interface seems to be ill-advised.) Nevertheless, I have committed your changes since at the moment they seem to cause no negative issues, but I will be the first to rip them out again should we observe any negative behaviour that might be associated with this commit.