Closed Bug 1792676 Opened 2 years ago Closed 9 months ago

[wayland] KeyboardEvent modifiers true on keyup instead of keydown

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 106
defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: lilydjwg, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

  1. open https://w3c.github.io/uievents/tools/key-event-viewer.html
  2. press Alt key once

Actual results:

For the keydown event, getModifierState is -, alt is false, and for keyup getModifierState is Alt and alt is true.

Expected results:

For the keydown event, getModifierState is Alt, alt is true, and for keyup getModifierState is - and alt is false.

On XWayland this issue doesn't happen. With Google Chrome this issue also doesn't happen.

I'm running Wayfire (wlroots-based wayland compositor) on Arch Linux, with Firefox Nightly.

I'm having issues with a cloud game site on which holding Alt key does nothing. With XWayland it works as expected.

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.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

I believe this is indeed the issue I have with the website, because when I press my other Alt key, the latter event's modifier attributes are expected, and it works for the website. This is an awkward workaround for me as holding two Alt keys for some time will trigger my keyboard to reset its key maps. I have to reach for my laptop's builtin keyboard.

I believe it's caused by the key-press-event from GTK only has the modifier state for the previous key. Firefox has handled this only for X11: https://searchfox.org/mozilla-central/source/widget/gtk/nsGtkKeyUtils.cpp#1787.

when I press my other Alt key

To clarify, I mean to hold one Alt key, and press the other one, because the modifier state is only on the latter keydown event.

Blocks: wayland
Priority: -- → P3
Duplicate of this bug: 1840174
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(stransky)

I see that on XWayland too. It may depend which events are queued and if we can detect modifier key in queue.

Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: NEW → ASSIGNED
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/e491a43ef9e8
[Wayland] Set modifiers according to key press/release r=emilio
Regressions: 1845060
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
QA Whiteboard: [qa-117b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: