GNOME Bugzilla – Bug 81759
double keys appearing in some applications
Last modified: 2011-02-04 16:10:07 UTC
Solaris 9 sparc, gnome version nightly build 14th May. Select applications - accessories - text editor In the text editor press a letter e.g. "A" - "AA" sometimes appears, you made need to make a few attempts for it to fail. Note, this fails irrespective of whether the keyboard preferences "keyboard repeats when key is held down" is set on or off. Also, if the is set to on, setting the delay before repeating option to Long and repeat speed to slow does not make any difference. The error is not specific to gedit, it can also be recreated by typing in the text input area of gnome-character-map.
closing bug as Solaris specific
I am facing this problem when I tested with the source on 1st July 2002. This is becoming a bottleneck for the test team.
GTKXIMContext may ask input methods whether it should filter key release events or not. Reopening this to get maintainer's opinion, and to review a patch.
Created attachment 10588 [details] [review] get XNFilterEvents of the current XIC to see if keyrelease events are requested
Looks like there is a missing bit to the patch ... it doesn't look like it adds the field to gtkimcontextxim.h I think this is really an input method bug ... XNFilterEvents are _extra_ events that the widget should ask for, not the only events the widget can ask for "The client is expected to augment its own event mask for the client window with this one" But the change should be harmless, and probably easier than fixing the input method. It might be good to put a comment into the source code about what input method it is that is buggy in this manner. The patch generally looks good. I think in terms of code organization it would be better to make gtk_im_context_xim_Get_ic() look like: === if (!context_xim->use_predit) context_xim->ic = get_ic_without_preedit (context_xim); else context_xim->ic = get_ic_with_preedit (context_xim); context_xim->filter_keyrelease = .. } return context_xim->ic; Duplicating the setting of context_xim->ic is a little confusing, even with the helper function.
thanks. I'll create a new patch soon.
Created attachment 10941 [details] [review] New diff with gtk_im_with_preeedt/gtk_im_without_preedit
Attaching a new diff. Appreciate a review once again and commit approval if it's okay. I'll create a patch for another Bug 90661 after I commit this.
gtk_im_with_preedit() isn't a good name ... I suggested get_ic_with_preedit() because namespacing isn't needed here. If you had the namespacing, it would be: gtk_im_context_get_ic_with_preedit() (gtk_im_context_filter_keyrelease() is also not so good a name; functions that return a boolean should generally be named should_filter_keyrelease() is_keyrelease_filtered() or something But I think I'd just do it inline in gtk_im_context_get_ic()) Minor nit: the line break in: + context_xim->filter_key_release = + gtk_im_context_filter_keyrelease (context_xim) Isn't necessary. I really would like a comment in here about why we are checking XNFilterEvents, since it (as I noted in my last comment) is *not* required by the XIM spec.
Created attachment 10984 [details] [review] comments for problematic input methods and get_ic_[with/without]_preedit
Please go ahead and commit to both branches; one small formatting note: the comment should have a line of * down the left side.
commit to both branches - marking fixed.