Bug 570286 - [GTK][Tree] Pressing Enter does not generate KeyDown event
Summary: [GTK][Tree] Pressing Enter does not generate KeyDown event
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.18   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.19 M3   Edit
Assignee: Soraphol (Paul) Damrongpiriyapong CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-01-12 07:27 EST by Thomas Singer CLA
Modified: 2021-02-16 12:04 EST (History)
4 users (show)

See Also:


Attachments
Snippet to reproduce (774 bytes, text/plain)
2021-01-12 07:28 EST, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2021-01-12 07:27:53 EST
Please run the attached snippet on Windows 10 and on Linux (tried on Ubuntu 20.04 and Manjaro). Press the main Enter key as well as the Return key on the keypad. For the Return key you will see the output

16777296  13

on both platforms, but only on Windows you will see the output

13  13

for the Enter key.
Comment 1 Thomas Singer CLA 2021-01-12 07:28:21 EST
Created attachment 285260 [details]
Snippet to reproduce
Comment 2 Thomas Singer CLA 2021-01-12 07:38:57 EST
Even a SWT.Traverse listener is not called when pressing the Enter key on Linux - at least inside the Tree control.
Comment 3 Thomas Singer CLA 2021-01-12 09:09:16 EST
I have bisected the SWT sources and the bug was introduced between v4936r17 (db7390ee) and v4936r18 (3fbc5c63). There are 2 commits

Bug 488772 (TreeDefaultSelectionOrder) - [Gtk][Tree] defaultSelection
Bug 565818 - [Regression] KeyEvent keyCode changed in 2020-09 M2

that might cause it.
Comment 4 Andrey Loskutov CLA 2021-01-12 09:47:51 EST
(In reply to Thomas Singer from comment #3)
> I have bisected the SWT sources and the bug was introduced between v4936r17
> (db7390ee) and v4936r18 (3fbc5c63). There are 2 commits
> 
> Bug 488772 (TreeDefaultSelectionOrder) - [Gtk][Tree] defaultSelection
> Bug 565818 - [Regression] KeyEvent keyCode changed in 2020-09 M2
> 
> that might cause it.

Most likely bug 488772 /  https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166617, if the problem appears on trees only. Paul, could you please take a look?
Comment 5 Andrey Loskutov CLA 2021-01-12 09:50:16 EST
(In reply to Andrey Loskutov from comment #4)
> Most likely bug 488772 / 
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/166617, if the
> problem appears on trees only. Paul, could you please take a look?

But https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/167295 looks also "good" :-)
Comment 6 Thomas Singer CLA 2021-01-12 10:01:15 EST
Reverting the commit

  Bug 488772 (TreeDefaultSelectionOrder) - [Gtk][Tree] defaultSelection

would solve this bug.
Comment 7 Andrey Loskutov CLA 2021-01-17 14:19:15 EST
(In reply to Thomas Singer from comment #6)
> Reverting the commit
> 
>   Bug 488772 (TreeDefaultSelectionOrder) - [Gtk][Tree] defaultSelection
> 
> would solve this bug.

Paul, please take a look.
Comment 8 Soraphol (Paul) Damrongpiriyapong CLA 2021-01-19 10:56:32 EST
Hello, I took a look and I believe reverting Bug 488772 is the best option. This is because that patch cause gtk_key_button_press to stop calling the super implementation and therefore no KeyDown event. I will try to find a different fix for the patch we are reverting.
Comment 9 Andrey Loskutov CLA 2021-02-10 16:25:00 EST
(In reply to Soraphol (Paul) Damrongpiriyapong from comment #8)
> Hello, I took a look and I believe reverting Bug 488772 is the best option.
> This is because that patch cause gtk_key_button_press to stop calling the
> super implementation and therefore no KeyDown event. I will try to find a
> different fix for the patch we are reverting.

Paul, would you please provide the revert gerrit? Would be good to have it before M3.
Comment 10 Eclipse Genie CLA 2021-02-11 11:19:19 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176127
Comment 11 Soraphol (Paul) Damrongpiriyapong CLA 2021-02-11 11:20:27 EST
Yep, I have provided the reversion that is required for the regression to be fixed.
Comment 13 Alexander Kurtakov CLA 2021-02-15 03:34:24 EST
Patch has been merged. Resolving.
Comment 14 Soraphol (Paul) Damrongpiriyapong CLA 2021-02-16 12:04:49 EST
Verified.

Eclipse SDK
Version: 2021-03 (4.19)
Build id: I20210216-0600
OS: Linux, v.5.9.15-200.fc33.x86_64, x86_64 / gtk 3.24.24, WebKit 2.30.4
Java version: 11.0.9.1