Wayland: no touch input (wl_touch is never bound) #159

Closed
opened 2026-10-06 13:25:45 +00:00 by jorijnvdgraaf · 0 comments

Summary

The Wayland backend has no touch input. Device::seat_handle_capabilities binds only the pointer and the keyboard (implementations/Crafter.Graphics-Device.cpp:499-509 at 6aa0338), and there is no wl_touch listener anywhere in the tree. On a touch-only session (phosh/phoc on a phone) a window renders but, as far as the code goes, receives nothing when the screen is touched.

Found by reading the code while bringing the UI path up on a Fairphone 6 (postmarketOS, phoc, wl_seat v9). I did not test touches on the device myself.

Suggested fix

Two levels, the second being a design decision:

  1. Minimal: handle WL_SEAT_CAPABILITY_TOUCH and map the first touch point onto the existing mouse path: down → move + left press, motion → move, up → left release. Coordinates need the same surface-local × scale conversion the pointer handlers use. No new public API.
  2. Proper: a touch event API on Window (touch id, position, phase) for multi-touch and gestures, with the mouse emulation above as the default for applications that do not subscribe.
## Summary The Wayland backend has no touch input. `Device::seat_handle_capabilities` binds only the pointer and the keyboard (`implementations/Crafter.Graphics-Device.cpp:499-509` at `6aa0338`), and there is no `wl_touch` listener anywhere in the tree. On a touch-only session (phosh/phoc on a phone) a window renders but, as far as the code goes, receives nothing when the screen is touched. Found by reading the code while bringing the UI path up on a Fairphone 6 (postmarketOS, phoc, `wl_seat` v9). I did not test touches on the device myself. ## Suggested fix Two levels, the second being a design decision: 1. **Minimal:** handle `WL_SEAT_CAPABILITY_TOUCH` and map the first touch point onto the existing mouse path: `down` → move + left press, `motion` → move, `up` → left release. Coordinates need the same surface-local × scale conversion the pointer handlers use. No new public API. 2. **Proper:** a touch event API on `Window` (touch id, position, phase) for multi-touch and gestures, with the mouse emulation above as the default for applications that do not subscribe.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Crafter.Graphics#159
No description provided.