Skip to content

[Wayland/KDE] Virtual touchscreen doesn't work until associated with an output #5371

Description

@abdecd

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?

This issue is present in the latest pre-release

Describe the Bug

I encountered an issue where touchscreen input doesn't work correctly on KDE Wayland.

Steps to reproduce:

  1. Start Sunshine on KDE Plasma Wayland.
  2. Connect using an Android client with native touchscreen forwarding support (tested with https://github.com/Axixi2233/moonlight-android).
  3. Switch to native Touch Mode.
  4. Tap anywhere on the desktop.

The touch input does not work correctly.

After some debugging, I found a reproducible workaround and collected a few observations that may help narrow down the issue.

Observed behavior:

  • While the touch input fails, KWin repeatedly logs:
    Could not find logical output for KWin::DrmOutput(...)
  • evtest receives the expected touch events.
  • libinput debug-events also reports correct touch events.

Findings:

The virtual touchscreen created by Sunshine (via Inputtino) has an empty outputName property in KWin's D-Bus interface.

When I manually assign the active output to the device through KWin's D-Bus API, touch input immediately starts working correctly and the KWin log messages stop.

I'm not sure whether this should ultimately be handled by Sunshine, Inputtino, or KWin, but I hope these findings help identify the appropriate component.

Expected Behavior

Touchscreen inputs should work.

Additional Context

As a temporary workaround, manually assigning the active output to the virtual touchscreen through KWin's D-Bus API immediately restores native touch input.

This bash script below worked for me:

#!/bin/bash
# Auto-detect active display
TARGET_OUTPUT=$(kscreen-doctor -j 2>/dev/null | jq -r '.outputs[] | select(.enabled == true) | .name' | head -n 1)
[ -z "$TARGET_OUTPUT" ] && exit 1

# Map Sunshine touch device to the display
for event in $(qdbus6 org.kde.KWin /org/kde/KWin/InputDevice org.kde.KWin.InputDeviceManager.ListTouch 2>/dev/null); do
    name=$(qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/$event org.freedesktop.DBus.Properties.Get org.kde.KWin.InputDevice name 2>/dev/null)
    if [ "$name" = "Touch passthrough" ]; then
        qdbus6 org.kde.KWin /org/kde/KWin/InputDevice/$event org.freedesktop.DBus.Properties.Set org.kde.KWin.InputDevice outputName "$TARGET_OUTPUT"
    fi
done

Host Operating System

Linux

Operating System Version

Linux kernel: 7.1.2-3-cachyos, KDE Plasma: 6.7.2, Wayland

Architecture

amd64/x86_64

Package

Linux - AUR (Third Party)

GPU Type

NVIDIA

GPU Model

NVIDIA GeForce RTX 5060 Ti

GPU Driver/Mesa Version

595.71.05

Capture Method

None

Apps

Log output

Online logs

https://gist.github.com/abdecd/c829f40e216868d3c606af42993af386

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