Skip to content

WaylandBackend: forward wl_touch input from the host compositor#2244

Open
brycesub wants to merge 1 commit into
ValveSoftware:masterfrom
brycesub:wayland-backend-touch-input
Open

WaylandBackend: forward wl_touch input from the host compositor#2244
brycesub wants to merge 1 commit into
ValveSoftware:masterfrom
brycesub:wayland-backend-touch-input

Conversation

@brycesub

@brycesub brycesub commented Jul 8, 2026

Copy link
Copy Markdown

The Wayland backend's input thread wires up pointer and keyboard input but never requests wl_touch from the seat — m_pTouch is declared but never used — so touchscreens do nothing whenever gamescope runs nested under another compositor.

This requests wl_touch when the seat advertises the capability and adds the listener on the input thread, translating down/up/motion into wlserver touch input. Coordinates are normalized with the same fractional-scale and plane-offset math the pointer path uses, and touch.cancel releases all held touch points so nothing gets stuck.

Testing: Steam gamepadui inside nested gamescope under KWin (Plasma 6) on a dual-screen ARM handheld (AYN Thor, Adreno 740/Turnip Mesa): taps land exactly on target, scrolling works, multi-touch ids are tracked, and gamescope's touch click modes behave the same as the embedded/SDL paths since events flow through the normal wlserver touch input. Validated on 3.16.24; applies to and compiles clean on current master.

The Wayland backend's input thread wires up pointer and keyboard input
but never requests wl_touch from the seat (m_pTouch was declared but
unused), so touchscreens are dead whenever gamescope runs nested under
another compositor.

Request wl_touch when the seat advertises the capability and translate
down/up/motion into wlserver touch input, normalizing surface-local
coordinates with the same fractional-scale and plane-offset math as the
pointer path. touch cancel releases all held touch points so nothing
gets stuck.

Tested with Steam inside nested gamescope under KWin (Plasma 6) on a
dual-screen ARM handheld: taps land on target, scrolling and
multi-touch id tracking work, and gamescope's touch click modes behave
the same as with the embedded/SDL paths since events flow through the
normal wlserver touch input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant