Bug 497050 - Using NumLock in Plasma Wayland sometimes causes gamescope to think Meta key is held down
Summary: Using NumLock in Plasma Wayland sometimes causes gamescope to think Meta key ...
Status: RESOLVED UPSTREAM
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 6.2.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-04 19:47 UTC by Matthew Schwartz
Modified: 2024-12-10 00:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schwartz 2024-12-04 19:47:22 UTC
SUMMARY
Under Plasma 6.2.4 Wayland and using gamescope's wayland backend, enabling the NumLock key on a physical keyboard will cause gamescope to think that the NumKey's pressed state is a Meta key. This causes an issue when trying to use gamescope's shortcut for fullscreening a window, Meta + F, instead causing the hotkey to be triggered only by pressing the F key without the Meta key. Disabling NumLock has a chance of either making Meta + F work correctly again, or totally killing keyboard hotkeys in gamescope until re-enabling NumLock.

I tested this under Gnome (Wayland) to try and narrow down the source of this issue, but so far every reporter (including myself) has only seen this happen under Plasma 6 Wayland.

Please let me know if there are any debugging logs that would be useful to include. I tried running `WAYLAND_DEBUG=1 gamescope -- vkcube` to see if I could get a debugging log to attach, but prefixing WAYLAND_DEBUG like that seems to totally kill hotkey usage in gamescope.

STEPS TO REPRODUCE

I would recommend building gamescope from the latest git commit for this, and starting with NumLock on.

1.  On Plasma 6.2.4 Wayland, launch gamescope from a terminal with `gamescope -- vkcube`
2.  Once gamescope launches, try using Meta + F a few times
3.  If this works, try pressing F a few times and see if that also triggers the fullscreen hotkey correctly

This issue is a bit spurious, which makes narrowing down the potential causes more difficult. Some boots I've had the hotkey work perfectly even with NumLock enabled from boot, other boots I have had this issue happen to me on the first launch of gamescope.

OBSERVED RESULT
Meta + F and just the F key trigger the same fullscreen hotkey in gamescope

EXPECTED RESULT
Only Meta + F should trigger the fullscreen hotkey in gamescope

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.1
Kernel Version: 6.13.0-rc1-1-cachyos-rc (64-bit)
Graphics Platform: Wayland
Processors: 64 × AMD Ryzen Threadripper 7970X 32-Cores
Memory: 62.3 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION
Link to original report: https://github.com/ValveSoftware/gamescope/issues/1637
Comment 1 Naxil 2024-12-08 11:53:30 UTC
here, the gamescope shortcut (like super+f) not be recognized at all! (instead kde,plasma shorcut works good like super+l (login shortcut)
Comment 2 Matthew Schwartz 2024-12-10 00:22:29 UTC
this happens under cosmic desktop as well, so I suspect the issue lies somewhere else in the wayland stack rather than having to do with Plasma in particular.