Bug 544296

Summary: [Gtk] Regression: KeyEvent keyCode no longer set
Product: [Eclipse Project] Platform Reporter: Patrick Tasse <patrick.tasse>
Component: SWTAssignee: Eric Williams <ericwill>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ericwill
Version: 4.11Keywords: regression, triaged
Target Milestone: 4.11 M3   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/136688
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=42bf7febc003b13ab578fc601862a0b5d36d2b78
Whiteboard: RHT

Description Patrick Tasse CLA 2019-02-08 15:52:37 EST
The keyCode in KeyEvent no longer has a value set, for example when pressing the '.' key.

Following the code in Widget.sendIMKeyEvent, the event parameter is 0, the ptr and state variables are set, but the event remains 0, which leads to calling setInputState instead of setKeyState.
Comment 1 Eric Williams CLA 2019-02-08 16:04:48 EST
Can you provide a snippet which demonstrates the issue? Also which OS/GTK3 version?
Comment 2 Patrick Tasse CLA 2019-02-08 16:40:54 EST
Hi Eric,

To reproduce, just put a breakpoint on Widget.sendIMKeyEvent(), then press the '.'  key on the keyboard.

I'm still using GTK 3.10.8 (the best GTK ;) on Ubuntu 14.04.
Comment 3 Patrick Tasse CLA 2019-02-08 16:51:35 EST
If it helps, the KeyEvent sent by gtk_key_release_event has the correct keycode and event is not 0. But on the key press, I don't see gtk_key_press_event, instead the KeyEvent comes from Canvas.gtk_commit where the event is hardcoded to 0.
Comment 4 Eclipse Genie CLA 2019-02-11 10:02:02 EST
New Gerrit change created: https://git.eclipse.org/r/136688
Comment 5 Eric Williams CLA 2019-02-11 10:03:20 EST
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/136688

Hi Patrick, would you be able to take a look at this patch? I believe it resolves the issue but I want to confirm with you (if possible) before merging.
Comment 7 Eric Williams CLA 2019-02-11 14:10:25 EST
(In reply to Eclipse Genie from comment #6)
> Gerrit change https://git.eclipse.org/r/136688 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=42bf7febc003b13ab578fc601862a0b5d36d2b78

In master now.
Comment 8 Eric Williams CLA 2019-02-19 09:28:50 EST
Verified in I20190219-0600.