Forward Wayland modifier events to wlroots seat when nested#2273
Open
bjornmp wants to merge 1 commit into
Open
Forward Wayland modifier events to wlroots seat when nested#2273bjornmp wants to merge 1 commit into
bjornmp wants to merge 1 commit into
Conversation
bjornmp
force-pushed
the
fix/wayland-nested-modifier-forwarding
branch
2 times, most recently
from
July 21, 2026 00:35
af4a50a to
8f9e787
Compare
When running nested on a Wayland compositor, gamescope received wl_keyboard.modifiers from the host but only stored them locally. Key events were injected through a virtual keyboard with no modifier state, so Xwayland clients saw key presses with state 0x0. Forward modifier updates to the keyboard group and inject keys through that keyboard so the seat reports correct Shift/Ctrl/Alt state. Fixes ValveSoftware#1740 Fixes ValveSoftware#2032 Co-authored-by: Cursor <cursoragent@cursor.com>
bjornmp
force-pushed
the
fix/wayland-nested-modifier-forwarding
branch
from
July 21, 2026 00:41
8f9e787 to
8d7e59d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When gamescope runs nested on a Wayland compositor, it receives
wl_keyboard.modifiersfrom the host compositor but previously only stored them locally. Key events were injected via a stub virtual keyboard with no modifier state, so clients (especially Xwayland apps) received key presses with modifier state0x0.This change forwards modifier events to the wlroots
keyboard_groupand injects keys through that keyboard, so the seat reports correct Shift/Ctrl/Alt state.Fixes #1740
Fixes #2032
Root cause
Discussed in #1740: older Xwayland versions ran their own XKB state machine and masked this bug. Xwayland 24.1.5+ correctly expects the compositor to forward modifier state (xserver MR 1758), which exposed the issue in gamescope.
Test plan
gamescope -- konsole— Shift+letters produce capitalsEnvironment
976f7fc) with this patchMade with Cursor