Skip to content

wlserver: support absolute pointer motion events - #2488

Open
sashakosti wants to merge 1 commit into
ValveSoftware:masterfrom
sashakosti:fix/absolute-pointer-motion
Open

sashakosti wants to merge 1 commit into
ValveSoftware:masterfrom
sashakosti:fix/absolute-pointer-motion

Conversation

@sashakosti

Copy link
Copy Markdown

Summary

Fixes #2458.

In DRM backend mode, absolute pointer devices (such as Sunshine / Moonlight remote desktop mouse mode, virtual HID tablets, and absolute digitizers) were unable to move the cursor because Gamescope never registered a listener for pointer motion_absolute events from wlroots.

Changes

  • Add struct wl_listener motion_absolute to struct wlserver_pointer in src/wlserver.hpp.
  • Implement wlserver_handle_pointer_motion_absolute() in src/wlserver.cpp, scaling normalized coordinates [0.0, 1.0] into active output dimensions (g_nOutputWidth, g_nOutputHeight with fallbacks) and focused window space, and warp the cursor via wlserver_mousewarp().
  • Register the events.motion_absolute listener during WLR_INPUT_DEVICE_POINTER device creation in wlserver_new_input().
  • Ensure pointer->motion_absolute.link is unlinked in wlserver_handle_pointer_destroy() when a pointer device is disconnected or removed.

In DRM backend mode, absolute pointer devices (such as Sunshine /
Moonlight in desktop remote-mouse mode, virtual HID tablets, and
absolute digitizers) were unable to move the cursor because Gamescope
never registered a listener for pointer motion_absolute events from
wlroots.

Add a motion_absolute listener to struct wlserver_pointer, map normalized
coordinates to output pixel space (with uninitialized output fallback)
and focused window surface coordinates, warp the cursor, and ensure the
listener link is cleanly removed in wlserver_handle_pointer_destroy().

Closes: ValveSoftware#2458
Co-authored-by: Antigravity <antigravity@google.com>
@sashakosti
sashakosti force-pushed the fix/absolute-pointer-motion branch from 546bb19 to 360356f Compare October 23, 2026 12:54
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.

Absolute pointer devices whose axis range exceeds the output never move the cursor (Sunshine / Moonlight remote-desktop mouse mode)

1 participant