[Wayland] HTML range inputs cannot be changed using mouse pointer
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: nicolas.vernon, Assigned: sinker)
References
(Blocks 1 open bug)
Details
Attachments
(5 files, 1 external file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:159.0) Gecko/20100101 Firefox/159.0
Steps to reproduce
On Linux Fedora 44 with KDE Plasma 6.8.2 with Wayland, I have Firefox 159.0. When I watch a youtube short, I can't change the volume with the mouse. I can only turn it on or off. It works with the keyboard. On a different browser (chromium), everything works. When i launch Firefox with MOZ_ENABLE_WAYLAND=0 firefox, everything works too => it is a problem between wayland and firefox
Actual results
The volume couldn't be changed with the mouse
Expected results
The volume should have changed when i clicked somewhere on the volume cursor
Élément Information
OS Fedora 44
Desktop KDE Plasma
Session Wayland
GPU NVIDIA GTX 1080 Ti
Firefox Version 159
Profil vierge Problem still present
Mode dépannage Problem still present
XWayland Works as it should with MOZ_ENABLE_WAYLAND=0
You can reproduce this bug on any page with this script :
const test = document.createElement('input');
test.type = 'range';
test.min = 0;
test.max = 100;
test.value = 50;
test.style = 'position:fixed;top:100px;left:100px;width:300px;height:40px;z-index:999999;background:white';
document.body.appendChild(test);
test.addEventListener('input', () => console.log('Nouveau volume :', test.value));
Comment 2•17 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Updated•17 days ago
|
| Assignee | ||
Comment 3•17 days ago
|
||
Thanks for the report and the test snippet!
Could you capture a log of the mouse events Firefox receives? Close Firefox completely first, then start it from a terminal with:
MOZ_LOG=Widget:5 MOZ_LOG_FILE=~/firefox-log WAYLAND_DEBUG=1 firefox 2> ~/wayland-log.txt
Open a page with your test slider, click on the slider track and try to drag the thumb a couple of times, then quit Firefox and attach both ~/firefox-log.moz_log and ~/wayland-log.txt here.
Thanks for your fast answear ! Requested files are attached to this ticket
Comment 7•15 days ago
|
||
Can you create a screencast of the issue?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Create_screenshot/screencast_for_a_bug_report
Thanks.
| Assignee | ||
Comment 8•15 days ago
|
||
Nicolas, thanks for the logs! Could you try one more thing? Save the attached range-events.html, open it in Firefox (Ctrl+O), drag the slider thumb right and left a few times, click once on the slider bar away from the thumb, then press "Save log" and attach the bug2089027-range-events.txt it downloads here. The page records where Firefox sends each click and drag.
FWIW the logs in comment 4 and 5 already show the input getting to Firefox. In the WAYLAND_DEBUG log each slider drag is a wl_pointer.button press, a steady stream of wl_pointer.motion (19 to 46 events) and a release, and every drag starts at x≈249, which is right on the thumb at value 50 (left 100px + 300px/2). The Widget log has the matching Button 1 press/release. So the events reach nsWindow and the thumb still doesn't move, which points past the widget layer. I can't reproduce it locally.
Here is the log file you asked for
| Reporter | ||
Comment 10•14 days ago
|
||
| Assignee | ||
Comment 11•12 days ago
|
||
Thanks for the log and the screencast, Nicolas! One quick test: please turn Scroll Lock off on your keyboard, then try dragging the slider again, and tell me whether it works now. If your keyboard backlight goes off with it, that's expected, and you can turn it back on afterwards.
Could you also paste the output of this command here, whether or not the slider works? It shows your keyboard setup:
xmodmap -pm; cat ~/.config/kxkbrc; localectl status
| Reporter | ||
Comment 12•10 days ago
|
||
(In reply to Thinker Li [:sinker] from comment #11)
Thanks for the log and the screencast, Nicolas! One quick test: please turn Scroll Lock off on your keyboard, then try dragging the slider again, and tell me whether it works now. If your keyboard backlight goes off with it, that's expected, and you can turn it back on afterwards.
Could you also paste the output of this command here, whether or not the slider works? It shows your keyboard setup:
xmodmap -pm; cat ~/.config/kxkbrc; localectl status
Thank you very much, that was exactly the problem. My keyboard needs backlighting to be usable and the key assigned to this is the scroll lock (Coolermaster CM Storm Keyboard). I can confirm that the slider works properly with scroll lock off.
On Chromium, it works with it on or off.
My keyboard setup :
`jacky@jacky-pc:~$ xmodmap -pm; cat ~/.config/kxkbrc; localectl status
xmodmap: up to 3 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_L (0xcc), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3 Scroll_Lock (0x4e), ISO_Level5_Shift (0xcb)
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce)
mod5 ISO_Level3_Shift (0x5c)
cat: /home/jacky/.config/kxkbrc: Aucun fichier ou dossier de ce nom
System Locale: LANG=fr_FR.UTF-8
VC Keymap: fr
X11 Layout: fr
X11 Model: pc105`
| Assignee | ||
Comment 13•8 days ago
|
||
With the XKB option scrolllock:mod3, Scroll Lock shares Mod3 with LevelFive.
While Scroll Lock is on, Mod3 is locked. KeymapWrapper::SetModifierMasks()
maps LEVEL5 to Mod3 (since bug 1827615), so ComputeKeyModifiers() sets
MODIFIER_ALTGRAPH on every event, and HTMLInputElement then ignores every
mouse press on <input type=range> (IgnoreInputEventWithModifier()).
GDK merges depressed, latched and locked modifiers into one state, so that
state can't tell a locked Mod3 from a held Level5 key. The
wl_keyboard.modifiers handler in nsWaylandDisplay now records the bits that
are locked but not held or latched, and ComputeKeyModifiers() leaves them out
of the Level3/Level5 check only. A held AltGr or Level5 key still reports
AltGraph, and ScrollLock and the other modifiers are unchanged. X11 is not
affected.
Updated•8 days ago
|
Description
•