After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 262637 - Wrong Undo operation of input method handling on editor
Wrong Undo operation of input method handling on editor
Status: RESOLVED FIXED
Product: GtkHtml
Classification: Other
Component: Editing
unspecified
Other All
: Normal major
: 2.0.1
Assigned To: gtkhtml-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2004-08-06 16:18 UTC by ynakai
Modified: 2004-09-16 10:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch for CJK undo fix. (4.46 KB, patch)
2004-08-06 16:19 UTC, ynakai
none Details | Review
Updated patch (4.48 KB, patch)
2004-08-12 08:57 UTC, ynakai
none Details | Review

Description ynakai 2004-08-06 16:18:29 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.
Comment 1 ynakai 2004-08-06 16:19:13 UTC
Created attachment 44048 [details] [review]
A patch for CJK undo fix.
Comment 2 ynakai 2004-08-10 08:27:50 UTC
Should be 'major' priority.
Comment 3 ynakai 2004-08-12 08:57:36 UTC
Created attachment 44067 [details] [review]
Updated patch
Comment 4 Gerardo Marin 2004-08-12 20:39:11 UTC
ynakai: please submit your patch to evolution-patches mailing list for
review. You may need to subscribe. See http://lists.ximian.com
Comment 5 ynakai 2004-08-13 07:42:45 UTC
OK, I will.
Comment 6 Radek Doulik 2004-09-16 10:38:45 UTC
fix is in cvs