GNOME Bugzilla – Bug 262637
Wrong Undo operation of input method handling on editor
Last modified: 2004-09-16 10:38:45 UTC
Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: When using input method, it records all pre-editing operations and shows up all at undo operation. Those are redundant, never on Microsoft or other proprietary standard, nor on traditional/modern apps of UN*X systems. Steps to reproduce the problem: 1. Use your favorite GTK+2 immodule which uses preedit. Or try im-euro if you are not CJK. http://www.gnomefiles.org/app.php?soft_id=330 (Below steps are for im-euro 2. Shift+Space to start euro input mode. 3. Press 'e' 'u' 'r' 'o' 4. Press space 5. Press return to commit 6. Press Undo button and 'euro' on the app 7. Press Undo button and nothing on the app 8. Press Undo button and 'eur' on the app 9. Press Undo button and nothing on the app 10. Press Undo button and 'eu' on the app 11. Press Undo button and nothing on the app 12. Press Undo button and 'e' on the app etc Actual Results: All preedit operations are for undo. Expected Results: No preedit operations are for undo. How often does this happen? Always Additional Information: The following patch adds freeze/unfreeze function to HtmlUndo class, to prevent recording undo action in gtk_html_im_preedit_changed_cb(). gtk_html_im_commit_cb() has a fix, but this fix needs some description. If an immodule clears the preedit string before commit, gtk_html_im_commit_cb() doesn't need this fix. But we cannot assume all immodules behave like that. And maybe most immodules do not clear preedit string before commit because of the implementation reason. A "preedit_changed" callback usually returns the copy of the preedit string buffer, and a "commit" callback also uses it. So developer don't want to clear preedit string buffer before commit. You might feel it's difficult to see the point, but if you implement a CJK immodule, you'll soon understand. Anyway, gtkhtml should not restrict each immodule behavior, but should support many variations of immodules. And I think some people might feel disagree to deleting preedit string in gtk_html_im_commit_cb(). Some input method support the style of commit while it has keep a part of preedit string. (Canna's C-j key combo really works like so.) But the original meaning of preedit is to let user choose the candidate for commit, so we should be able to assume immodules will call "preedit_changed" after commit, if they want to have preedit string after commit.
Created attachment 44048 [details] [review] A patch for CJK undo fix.
Should be 'major' priority.
Created attachment 44067 [details] [review] Updated patch
ynakai: please submit your patch to evolution-patches mailing list for review. You may need to subscribe. See http://lists.ximian.com
OK, I will.
fix is in cvs