Bug 466657 - Discarding the key events and same output regardless of the key
Summary: Discarding the key events and same output regardless of the key
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: scim
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peng Huang
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F10Target 452849
TreeView+ depends on / blocked
 
Reported: 2008-10-12 10:44 UTC by Akira TAGOH
Modified: 2008-12-02 00:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-02 00:54:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test code for discarding the key event issue (22.21 KB, text/plain)
2008-10-14 10:43 UTC, Akira TAGOH
no flags Details
test code for output the same result regardless of the key (23.28 KB, text/plain)
2008-10-14 10:47 UTC, Akira TAGOH
no flags Details
test code for discarding the key event issue (22.26 KB, text/plain)
2008-10-15 09:05 UTC, Akira TAGOH
no flags Details
proposed patch (3.98 KB, patch)
2008-10-15 11:18 UTC, Akira TAGOH
no flags Details | Diff

Description Akira TAGOH 2008-10-12 10:44:22 UTC
Description of problem:
key input too faster and too much messes up SCIM.

Version-Release number of selected component (if applicable):
scim-1.4.7-34.fc10

Steps to Reproduce:
1.input something too much and too faster
2.
3.
  
Actual results:
discarding the key event or return the same key event regardless of what pressing/releasing the key.

Expected results:
should works expectedly.

Additional info:
Technically it happens when multiple XIM_FORWARD_EVENT is added to the property when the key event is delivered faster than processing it in SCIM. and when it's there more than 4 in the property, it results the same output regardless of what you are pressing/releasing the key. otherwise the key event is discarded.
Why it returns the same key event when the property has something more than 4, IMdkit is getting the value from the property wrongly. a quote from man page:

int XGetWindowProperty(Display *display, Window w, Atom property, long
       long_offset, long long_length, Bool delete, Atom reg_type, Atom
       *actual_type_return, int *actual_format_return, unsigned long
       *nitems_return, unsigned long *bytes_after_return, unsigned char
       **prop_return);
...
long_length
          Specifies the length in 32-bit multiples of the data to be
          retrieved.

and XGetWindowProperty won't delete the property value even if "delete" is True, when there are still unread data.

To do the right thing, read the data with the proper length to not discard the event. and if there are still the unread data in the property, read next data with "long_offset".

Comment 1 Peng Huang 2008-10-14 03:07:48 UTC
Could you provide a patch to fix XIM problem? Thanks.

Comment 2 Akira TAGOH 2008-10-14 10:43:58 UTC
Created attachment 320277 [details]
test code for discarding the key event issue

% gcc scim_discarding.c `pkg-config --cflags --libs gtk+-2.0 gio-2.0`
% GTK_IM_MODULE=xim XMODIFIERS=@im=SCIM ./a.out

After pressing the button, "ab" should be put on the entry. otherwise SCIM may be discarding the forward event.

Comment 3 Akira TAGOH 2008-10-14 10:47:45 UTC
Created attachment 320278 [details]
test code for output the same result regardless of the key

% gcc scim_repeat.c `pkg-config --cflags --libs gtk+-2.0 gio-2.0`
% GTK_IM_MODULE=xim XMODIFIERS=@im=SCIM ./a.out

After pressing the button, "abc" should be put to the entry box. but actual result is "aaaaaa". this testing code is sending KeyPress and KeyRelease events for "a", "b" and "c". and usually GTK+ and other toolkits doesn't take any actions for KeyRelease event. thus, this means SCIM sends back the forward event for "a" with KeyPress 6 times.

Comment 4 Akira TAGOH 2008-10-15 09:05:18 UTC
Created attachment 320407 [details]
test code for discarding the key event issue

missed one ClientMessage event

Comment 5 Akira TAGOH 2008-10-15 11:18:44 UTC
Created attachment 320412 [details]
proposed patch

Comment 6 Peng Huang 2008-10-16 02:35:45 UTC
Fixed in scim-1.4.7-35.fc10. Thanks.

Comment 7 Bug Zapper 2008-11-26 03:48:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.