WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
257910
[GTK] No key modifier present in wheel event
https://bugs.webkit.org/show_bug.cgi?id=257910
Summary
[GTK] No key modifier present in wheel event
Elie Donadio
Reported
2023-06-09 13:54:52 PDT
Created
attachment 466656
[details]
test case of the bug The modifier key (ctrlKey, shiftKey,...) properties of the WheelEvent are always false when read from a wheel event callback. Tested in Epiphany 44.3-1 and in an embedded application using Webkit2gtk 2.40.2-1, on Arch Linux. A test case is provided as an attachement. When scrolling over the red square while the Ctrl key is held down, should turn green. Passes on Firefox 114.0.
Attachments
test case of the bug
(686 bytes, text/html)
2023-06-09 13:54 PDT
,
Elie Donadio
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Elie Donadio
Comment 1
2023-06-10 02:25:33 PDT
I've done a first investigation myself on the question, and I found the problem to be here :
https://github.com/WebKit/WebKit/blob/ef93c1b412c09e10975907c8fd683269eb36a413/Source/WebKit/Shared/gtk/NativeWebWheelEventGtk.cpp#LL41C13-L41C13
The modifier events that could have been extracted from the GtkEventScroll are not transmitted to the constructor of WebEvent. This is handled better for key presses (
https://github.com/WebKit/WebKit/blob/ef93c1b412c09e10975907c8fd683269eb36a413/Source/WebKit/Shared/gtk/WebEventFactory.cpp#L259
), where a factory function parses the GtkEventScroll.state property and transmits the modifier keys using the modifiersForEvent(const GdkEvent*) function. This is my first time delving into the Webkit codebase and I'm not a professional programmer so I don't really want to make the change myself, but I can try if nobody's up for it...
Elie Donadio
Comment 2
2023-06-10 02:35:09 PDT
See also
https://github.com/WebKit/WebKit/blob/ef93c1b412c09e10975907c8fd683269eb36a413/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp#L1409
for where the event is handled on the Gtk side and first dispatched to the page Proxy. Strangely enough the key modifiers are even queried a few lines up (l402), but never checked again further down the call stack.
Michael Catanzaro
Comment 3
2023-06-10 07:15:55 PDT
Nice investigation. This probably explains why all those "hold Ctrl to scroll" maps on various websites do not work.
Michael Catanzaro
Comment 4
2023-06-12 08:19:58 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/14863
EWS
Comment 5
2023-06-12 23:08:36 PDT
Committed
265104@main
(c313668f2cf7): <
https://commits.webkit.org/265104@main
> Reviewed commits have been landed. Closing PR #14863 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug