Open Bug 1565736 Opened 5 years ago Updated 2 years ago

Sometimes modifier keys do not work properly in Linux

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

All
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: germionabest26, Unassigned)

Details

  • To reproduce:
  1. Open a new tab in Firefox on Linux.
  2. Execute the following code snippet in the developer console:
document.onkeydown = e => {
    if (e.key === 'Alt') console.log('Alt: ' + e.altKey);
    else if (e.key === 'Control') console.log('Control: ' + e.ctrlKey);
    else if (e.key === 'Shift') console.log('Shift: ' + e.shiftKey);
};
  1. Focus on the page and start pressing Alt or Ctrl or Shift.
  • Actual Results:
    Sometimes it is happens often, sometimes it is happens seldom, but it happens, so I recommend to press each modifier for at least 100 or 1000 times. For example, you can see my result on the following screenshot

  • Expected Results:
    Always True in the console

It works in Firefox 67.0.4 on Arch Linux with 5.1.15-arch1-1-ARCH kernel. The issue can be reproduced in Firefox Nightly 69.0a1.20190521.
Also works in the Firefox Nightly 70.0a1.20190712 on Kali-Rolling 2019.2 based on Debian.
Not reproducible in Chromium 75.0.3770.100.

Hi ,

I've chosen a component for this bug in hope that someone with more expertise may look at it. We'll await their answer. If you consider that there's another component that's more proper for this case you may change it.

Regards, Flor.

Component: General → DOM: UI Events & Focus Handling
Product: Firefox → Core
Target Milestone: Firefox 67 → ---

I was unable to represent that behavior with Firefox 72 nightly on KUbuntu 18.04, so I' ran a quick mozregression:
70.0a1 from 2019-07-08 didn't contain it either.

That means either your DE/individual setup is causing issues (have you tried a clean profile?) or we didn't have the same test procedure.
Initially I tested on about:blank but I retried that on the new tab page just no and was unable to experience an issue.

Do both OS run Gnome by any chance?

Priority: P1 → --

On Linux, modifier state is updated every after pressing and releasing key event, but modifier state of DOM keyboard event for modifier keys needs to include the following modifier state. Therefore, we look for a next event in X11. So, I guess that on the reporter's environment, the next event may be sometimes different event or there is sometimes no events. I bet to the former. I'll post a test build which can log the next events of modifier key press/releases.

Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.