LizardByte / LizardByte/Sunshine

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

Open
#5,371 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.3k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your issue described in the documentation?

- [x] 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:

```bash
#!/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

```json

```

### Log output

```shell

```

### Online logs

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure on KDE Plasma Wayland using the Android native touch mode steps, then inspect the virtual touchscreen created through Inputtino and the KWin D-Bus outputName state. Use the reported KWin logs, evtest results, and workaround script to trace ownership of the missing association. Done means touchscreen input works without manually assigning an output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.