[PR #36] [MERGED] fix(touchscreen): remove BTN_LEFT from virtual touchscreen #39

Closed
opened 2026-10-15 12:51:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/inputtino/pull/36
Author: @htrex
Created: 3/18/2026
Status: ✅ Merged
Merged: 3/18/2026
Merged by: @ABeltramo

Base: stable ← Head: fix/touchscreen-remove-btn-left


📝 Commits (1)

  • ef30163 fix(touchscreen): remove BTN_LEFT from virtual touchscreen device

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 src/uinput/touchscreen.cpp (+0 -1)

📄 Description

Problem

The virtual touchscreen created by create_touch_screen() registers BTN_LEFT alongside BTN_TOUCH. Real touchscreen hardware only reports BTN_TOUCH — BTN_LEFT is a mouse button.

This causes GNOME/Mutter on Wayland to misclassify the device as a pointer, which breaks touchscreen-to-display mapping (dconf output setting is ignored).

Root cause chain

  1. udev input_id (systemd source): BTN_LEFT (= BTN_MOUSE) + ABS_X/Y → is_abs_mouse = true. This check runs before the is_touchscreen check, so the device gets both ID_INPUT_MOUSE=1 and ID_INPUT_TOUCHSCREEN=1.

  2. libinput: dual udev tags → device gets both pointer and touch capabilities.

  3. Mutter determine_device_type() (mutter source): checks LIBINPUT_DEVICE_CAP_POINTER before LIBINPUT_DEVICE_CAP_TOUCH → device is classified as CLUTTER_POINTER_DEVICE.

  4. Mutter meta-input-mapper.c: get_device_settings() only reads dconf touchscreen-to-display mapping for CLUTTER_TOUCHSCREEN_DEVICE — pointer devices get no mapping → touch events go to the wrong display.

Fix

Remove BTN_LEFT from create_touch_screen(). It was never emitted anyway — place_finger() and release_finger() only write ABS_MT_*, ABS_PRESSURE, and BTN_TOUCH events. Likely a leftover from the mouse device template.

Verified

Tested with Sunshine + Moonlight (PR #1364 native multitouch) streaming to an Android tablet as a third display on GNOME 49 / Wayland. Without BTN_LEFT:

  • udev: only ID_INPUT_TOUCHSCREEN=1
  • libinput: only touch capability
  • Mutter: CLUTTER_TOUCHSCREEN_DEVICE → dconf mapping works
  • Touch input correctly mapped to the target display

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/inputtino/pull/36 **Author:** [@htrex](https://github.com/htrex) **Created:** 3/18/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@ABeltramo](https://github.com/ABeltramo) **Base:** `stable` ← **Head:** `fix/touchscreen-remove-btn-left` --- ### 📝 Commits (1) - [`ef30163`](https://github.com/games-on-whales/inputtino/commit/ef30163cf95ba839d6f4616ff983a83c4ad99383) fix(touchscreen): remove BTN_LEFT from virtual touchscreen device ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/uinput/touchscreen.cpp` (+0 -1) </details> ### 📄 Description ## Problem The virtual touchscreen created by `create_touch_screen()` registers `BTN_LEFT` alongside `BTN_TOUCH`. Real touchscreen hardware only reports `BTN_TOUCH` — `BTN_LEFT` is a mouse button. This causes GNOME/Mutter on Wayland to misclassify the device as a pointer, which breaks touchscreen-to-display mapping (dconf `output` setting is ignored). ## Root cause chain 1. **udev `input_id`** ([systemd source](https://github.com/systemd/systemd/blob/v257/src/udev/udev-builtin-input_id.c#L244)): `BTN_LEFT` (= `BTN_MOUSE`) + `ABS_X/Y` → `is_abs_mouse = true`. This check runs *before* the `is_touchscreen` check, so the device gets **both** `ID_INPUT_MOUSE=1` and `ID_INPUT_TOUCHSCREEN=1`. 2. **libinput**: dual udev tags → device gets both `pointer` and `touch` capabilities. 3. **Mutter `determine_device_type()`** ([mutter source](https://gitlab.gnome.org/GNOME/mutter/-/blob/main/src/backends/native/meta-input-device-native.c)): checks `LIBINPUT_DEVICE_CAP_POINTER` **before** `LIBINPUT_DEVICE_CAP_TOUCH` → device is classified as `CLUTTER_POINTER_DEVICE`. 4. **Mutter `meta-input-mapper.c`**: `get_device_settings()` only reads dconf touchscreen-to-display mapping for `CLUTTER_TOUCHSCREEN_DEVICE` — pointer devices get no mapping → touch events go to the wrong display. ## Fix Remove `BTN_LEFT` from `create_touch_screen()`. It was never emitted anyway — `place_finger()` and `release_finger()` only write `ABS_MT_*`, `ABS_PRESSURE`, and `BTN_TOUCH` events. Likely a leftover from the mouse device template. ## Verified Tested with Sunshine + Moonlight (PR #1364 native multitouch) streaming to an Android tablet as a third display on GNOME 49 / Wayland. Without `BTN_LEFT`: - udev: only `ID_INPUT_TOUCHSCREEN=1` - libinput: only `touch` capability - Mutter: `CLUTTER_TOUCHSCREEN_DEVICE` → dconf mapping works - Touch input correctly mapped to the target display --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:51:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/inputtino#39
No description provided.