Keypresses are repeated as if key is stuck, ignores modifier

Bug #2079819 reported by Julian Andres Klode
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ibus (Ubuntu)
New
Undecided
Unassigned
mutter (Ubuntu)
New
Undecided
Unassigned

Bug Description

I switch into Mattermost with Windows+3 key combination, this causes an endless stream of 3 to be written into the mattermost field until I press another key (similarly for any other number key, I did not try non-numbers)

If we look at the keyboard input device with https://github.com/DIGImend/evdev-dump we can see that the key is not stuck, all the input events are correct:

/dev/input/event4 1725622057.447632 EV_MSC MSC_SCAN 0x000000DB
/dev/input/event4 1725622057.447632 EV_KEY KEY_LEFTMETA 0x00000002
^ press windows key
/dev/input/event4 1725622057.447632 EV_SYN SYN_REPORT 0x00000000
/dev/input/event4 1725622057.477343 EV_MSC MSC_SCAN 0x00000004
/dev/input/event4 1725622057.477343 EV_KEY KEY_3 0x00000001
^ press key 3
/dev/input/event4 1725622057.477343 EV_SYN SYN_REPORT 0x00000000
/dev/input/event4 1725622057.627896 EV_MSC MSC_SCAN 0x00000004
/dev/input/event4 1725622057.627896 EV_KEY KEY_3 0x00000000
^ release key 3
/dev/input/event4 1725622057.627896 EV_SYN SYN_REPORT 0x00000000
/dev/input/event4 1725622057.997495 EV_MSC MSC_SCAN 0x000000DB
/dev/input/event4 1725622057.997495 EV_KEY KEY_LEFTMETA 0x00000000
^ release windows key (now it starts endlessly dumping 3 into mattermost)

/dev/input/event4 1725622057.997495 EV_SYN SYN_REPORT 0x00000000
/dev/input/event4 1725622059.869769 EV_MSC MSC_SCAN 0x000000DB
/dev/input/event4 1725622059.869769 EV_KEY KEY_LEFTMETA 0x00000001
^ press windows key again
/dev/input/event4 1725622059.869769 EV_SYN SYN_REPORT 0x00000000
/dev/input/event4 1725622059.919605 EV_MSC MSC_SCAN 0x00000009
/dev/input/event4 1725622059.919605 EV_KEY KEY_8 0x00000001
^ press 8 to switch to the terminal window

This only affects Xwayland, native Wayland clients behave correctly.

ProblemType: Bug
DistroRelease: Ubuntu 24.10
Package: xwayland 2:24.1.2-1
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Uname: Linux 6.8.0-31-generic x86_64
NonfreeKernelModules: zfs
ApportVersion: 2.30.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: GNOME
Date: Fri Sep 6 13:26:18 2024
InstallationDate: Installed on 2022-11-26 (650 days ago)
InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Alpha amd64 (20221126)
SourcePackage: xwayland
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Julian Andres Klode (juliank) wrote :
description: updated
Revision history for this message
Julian Andres Klode (juliank) wrote :

Oddly I saw this in Wayland clients now too in plucky

affects: xwayland (Ubuntu) → libinput (Ubuntu)
summary: - xwayland repeats keypresses, ignores modifier
+ Keypresses are repeated as if key is stock, ignores modifier
Revision history for this message
Julian Andres Klode (juliank) wrote : Re: Keypresses are repeated as if key is stock, ignores modifier

I'll try to see if I can run libinput debug-events next time it happens

Revision history for this message
Julian Andres Klode (juliank) wrote :

I am getting this multiple times a day with the new keyboard.

I pressed backspace for a bit today

Event: time 1732724530.116877, -------------- SYN_REPORT ------------
Event: time 1732724530.150868, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 2
Event: time 1732724530.150868, -------------- SYN_REPORT ------------
Event: time 1732724530.163546, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7002a
Event: time 1732724530.163546, type 1 (EV_KEY), code 14 (KEY_BACKSPACE), value 0

After this I pressed d a couple times.

It took multiple seconds after i stopped for the terminal window to suddenly register all the `d` inputs, it's as is wayland's input processing thread for keyboard is blocked from running. Mouse works.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Reassigning to mutter, this is a bug in the key repeat implementation there, I just had

KEY_X(45) pressed
KEY_X(45) released

in libinput debug-events, but then the key kept repeating.

I think I need to set up mutter tracing.

affects: libinput (Ubuntu) → mutter (Ubuntu)
Revision history for this message
Julian Andres Klode (juliank) wrote :

This sounds related:

https://gitlab.gnome.org/GNOME/mutter/-/issues/203

Basically since each keypress gets delivered to ibus it could be the ibus that's breaking things and causing its own repeat.

summary: - Keypresses are repeated as if key is stock, ignores modifier
+ Keypresses are repeated as if key is stuck, ignores modifier
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.