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 81759 - double keys appearing in some applications
double keys appearing in some applications
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Input Methods
unspecified
Other Solaris
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-05-14 14:36 UTC by robert.kinsella
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
get XNFilterEvents of the current XIC to see if keyrelease events are requested (2.12 KB, patch)
2002-08-20 01:04 UTC, Hidetoshi Tajima
none Details | Review
New diff with gtk_im_with_preeedt/gtk_im_without_preedit (8.14 KB, patch)
2002-09-07 00:45 UTC, Hidetoshi Tajima
none Details | Review
comments for problematic input methods and get_ic_[with/without]_preedit (7.59 KB, patch)
2002-09-09 17:57 UTC, Hidetoshi Tajima
none Details | Review

Description robert.kinsella 2002-05-14 14:36:05 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.
Comment 1 robert.kinsella 2002-05-15 10:09:49 UTC
closing bug as Solaris specific
Comment 2 prabhut 2002-07-03 04:12:47 UTC
I am facing this problem when I tested with the source on 1st July 
2002.
This is becoming a bottleneck for the test team.
Comment 3 Hidetoshi Tajima 2002-08-20 00:36:32 UTC
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.


Comment 4 Hidetoshi Tajima 2002-08-20 01:04:57 UTC
Created attachment 10588 [details] [review]
get XNFilterEvents of the current XIC to see if keyrelease events are requested
Comment 5 Owen Taylor 2002-09-06 19:07:36 UTC
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.
Comment 6 Hidetoshi Tajima 2002-09-06 22:01:07 UTC
thanks. I'll create a new patch soon.
Comment 7 Hidetoshi Tajima 2002-09-07 00:45:22 UTC
Created attachment 10941 [details] [review]
New diff with gtk_im_with_preeedt/gtk_im_without_preedit
Comment 8 Hidetoshi Tajima 2002-09-07 00:48:38 UTC
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.
Comment 9 Owen Taylor 2002-09-07 19:42:27 UTC
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.
Comment 10 Hidetoshi Tajima 2002-09-09 17:57:25 UTC
Created attachment 10984 [details] [review]
comments for problematic input methods and get_ic_[with/without]_preedit
Comment 11 Owen Taylor 2002-09-10 14:03:33 UTC
Please go ahead and commit to both branches; one small
formatting note: the comment should have a line of 
* down the left side.
Comment 12 Hidetoshi Tajima 2002-09-10 18:24:41 UTC
commit to both branches - marking fixed.