[Linux][Wayland][GNOME/Mutter] Workaround for Native Pen/Touch Support coordinates misaligned with multiple displays

Abierto
#5,592 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp, linux

Línea de trabajo

Comienza reproduciendo la entrada nativa de pantalla táctil en Linux Wayland con GNOME/Mutter y varias pantallas, utilizando la configuración de XDG Portal Grab descrita. Compara el comportamiento de las coordenadas antes y después de asignar la pantalla táctil de Sunshine a una salida con el comando de GSettings documentado. Se considera completado cuando las coordenadas táctiles coinciden con la pantalla transmitida sin requerir una solución manual específica del sistema.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

By default on GNOME/Mutter running Wayland, native touchscreen input from Moonlight can be spatially misaligned when multiple displays are connected.

The issue is not specific to Mutter virtual monitors. I encountered it while streaming to a Mutter virtual monitor and XDG Portal Grab, I had previously experienced the same touchscreen misalignment with a physical display created using a dummy HDMI/DP adapter and KMS capture.

Expected Behavior

Touch input should be mapped to the display being streamed, with the touch coordinates corresponding to the same physical/logical positions shown by Moonlight.

With multiple displays connected, touch input should not be offset or interpreted relative to another display.

Additional Context

here is a confirmed workaround on GNOME/Mutter that fixes the touchscreen alignment.

Mutter has a per-device touchscreen output setting that can explicitly associate a touchscreen with a specific display.

For example, on my system:

gsettings set \
  'org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/1209:0004/' \
  output "['MetaVendor', 'MetaVirtualMonitor', '0x00']"

After assigning the Sunshine touchscreen to the correct output, native touch coordinates from Moonlight are correctly aligned with that display.

The device ID and output tuple are system-specific. The values above correspond to my setup; physical displays will have their own output identity. For example, my Mutter virtual monitor exposes:

['MetaVendor', 'MetaVirtualMonitor', '0x00']

The important part is the explicit association between the Sunshine touchscreen and the output being streamed.

This also indicates that the issue is not inherently caused by virtual displays. I have reproduced the same touchscreen misalignment with a physical display created through a dummy HDMI/DP adapter and KMS capture. The common factor is having multiple outputs while using absolute/native touchscreen input.

The touchscreen itself appears to provide usable absolute coordinates; explicitly changing the Mutter output association changes the coordinate mapping and fixes the problem.

I am not suggesting that Sunshine necessarily needs to implement this exact GSettings mechanism. The purpose of this report is to document the confirmed GNOME/Mutter workaround and provide a concrete lead for determining where the appropriate long-term fix belongs.

There are also reports of similar multi-display touchscreen issues under other Wayland compositors, including KDE Plasma/KWin, but I have not independently verified an equivalent fix there, so I am not making a claim about the KDE implementation.

The main confirmed finding here is:

On GNOME/Mutter Wayland, explicitly mapping the Sunshine touchscreen device to the intended output fixes native touchscreen misalignment with multiple displays.

Host Operating System

Linux

Operating System Version

Arch Linux

Architecture

other, n/a

Package

Linux - flathub/flatpak

GPU Type

n/a

GPU Model

n/a

GPU Driver/Mesa Version

n/a

Capture Method

XDG Portal Grab (FreeBSD/Linux)

Apps

Log output

Online logs

No response

Lenguaje dominante
C++
Estrellas
43k
Forks
2.4k
Merge medio
1 d 15 h
PR fusionados (30 d)
105

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de LizardByte/Sunshine

Todos los issues de LizardByte/Sunshine

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.