Skip to content

[Bug]: Absolute mouse coordinates stuck on headless host with mismatched client resolution (libvirtualhid) #5692

Closed

Description

@RaDeoN1992

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

None

Describe the Bug

Description:
When using Moonlight with "Optimize mouse for remote desktop" (absolute mouse coordinates) enabled, the cursor gets stuck at invisible boundaries and cannot reach the edges of the screen if the host resolution is significantly smaller than the client resolution.

This issue started after the migration to libvirtualhid in version 2026.906.222525. Rolling back to 2026.516.143833 resolves the issue completely.

Reproduction Steps:

  1. Set up a headless Linux host (Debian, XFCE) using a dummy Xorg display with a low resolution (e.g., 1368x768).
  2. Connect using Moonlight from a client with a much higher native resolution (e.g., CachyOS KDE Wayland at 3840x2160).
  3. Ensure "Optimize mouse for remote desktop" is checked in the Moonlight client.
  4. Move the mouse around the host desktop.

Expected Behavior:
The absolute mouse coordinates should scale proportionally to the host's resolution, allowing the cursor to reach all edges of the 1368x768 desktop, exactly as it did in v2026.516 using the older Inputtino backend.

Actual Behavior:
The cursor gets trapped in a restricted area on the host and cannot reach the edges. The new libvirtualhid implementation seems to enforce a strict 1:1 pixel mapping or fails to scale the absolute touch/pen coordinates when the client sends data for a 4K grid but the host workspace is much smaller.

Environment:

  • Host OS: Debian (Headless VPS, Xorg dummy display, XFCE)
  • Client OS: CachyOS Linux (KDE Plasma, Wayland)
  • Moonlight Client Version: 6.1.0
  • Sunshine Version: 2026.906.222525 (Bugged) / 2026.516.143833 (Working)

Expected Behavior

The absolute mouse coordinates should scale proportionally to the host's resolution. When moving the mouse across the client's native 4K display, the cursor on the host should properly map to and reach all edges of the 1368x768 desktop space, exactly as it functioned in v2026.516 using the older Inputtino backend.

Additional Context

  • Host Environment: Headless VPS running Debian with XFCE and a dummy Xorg display forced to 1368x768.
  • Client Environment: CachyOS Linux (KDE Plasma on Wayland) running Moonlight v6.1.0 at 3840x2160.
  • Workaround: Downgrading Sunshine from 2026.906.222525 to 2026.516.143833 completely resolves the issue, confirming that the new libvirtualhid implementation fails to scale the absolute touch/pen coordinates when the client and host resolutions are heavily mismatched.

Host Operating System

Linux

Operating System Version

Debian Trixie (Kernel 6.12.107-1)

Architecture

amd64/x86_64

Package

Linux - deb

GPU Type

none (software encoding)

GPU Model

None (Headless VPS, libx264 CPU encoding)

GPU Driver/Mesa Version

/A (Headless / CPU encoding)

Capture Method

X11 (FreeBSD/Linux)

Apps

Log output

Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY8 (id: 8)DUMMY8 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY9 (id: 9)DUMMY9 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY10 (id: 10)DUMMY10 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY11 (id: 11)DUMMY11 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY12 (id: 12)DUMMY12 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY13 (id: 13)DUMMY13 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY14 (id: 14)DUMMY14 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Detected display: DUMMY15 (id: 15)DUMMY15 connected: false
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.524]: Info: Screencasting with X11
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.525]: Info: Streaming display: DUMMY0 with res 1368x768 offset by 0x0
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: Creating encoder [libx264]
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: Color coding: SDR (Rec. 601)
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: Color depth: 8-bit
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: Color range: MPEG
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: Streaming bitrate is 14988000
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.526]: Info: [libx264 @ 0x7f1ac4003480] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.532]: Info: [libx264 @ 0x7f1ac4003480] profile High, level 4.2, 4:2:0, 8-bit
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.539]: Info: Minimum FPS target set to ~30fps (33.3333ms)
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.778]: Info: Found default monitor by name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Sep 11 22:57:31 deny sunshine[1893]: [2026-09-11 22:57:31.801]: Info: Opus initialized: 48 kHz, 2 channels, 512 kbps (total), LOWDELAY

Online logs

No response

Activity

  1. ReenigneArcher commented on Sep 12, 2026

    @ReenigneArcher
    Member

    Already fixed by LizardByte/libvirtualhid#129

    Will make it to Sunshine soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions