https://bugs.kde.org/show_bug.cgi?id=526812

            Bug ID: 526812
           Summary: Keyboard-only portal sessions falsely advertise
                    touchscreen support
    Classification: Plasma
           Product: xdg-desktop-portal-kde
      Version First 6.7.91
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 196951
  --> https://bugs.kde.org/attachment.cgi?id=196951&action=edit
Standalone reproducer that opens a keyboard-only RemoteDesktop portal session,
prints Wayland seat capabilities before, during, and after the session, and
closes it on Enter. Sends no input events.

SUMMARY

Keyboard-only portal sessions falsely advertise touchscreen support

On KDE Plasma Wayland, starting a keyboard-only RemoteDesktop portal session
adds touch support to the Wayland seat on a laptop without a touchscreen.
Chromium/Electron then reports a coarse pointer and 10 touch points.

KDE's tablet mode is disabled.

STEPS TO REPRODUCE

Dependencies: Python 3, dbus-python, PyGObject, and wayland-info.

1. Run the attached standalone reproducer:
   python3 keyboard-portal-repro.py
2. Approve the keyboard access request.
3. Leave the reproducer waiting for Enter.
4. In a native Wayland Chromium/Electron window, evaluate:
   matchMedia('(any-pointer: coarse)').matches
   navigator.maxTouchPoints
5. Press Enter in the reproducer to close the session.
6. Check the browser values again.

OBSERVED RESULT

The reproducer requests keyboard access with SelectDevices types=1. The portal
confirms granted device types=1.

The reproducer prints:

before: capabilities: pointer keyboard
Granted device types: 1
active: capabilities: pointer keyboard touch
closed: capabilities: pointer keyboard

Before the session opens, the same Electron window reports:
- any-pointer: coarse is false.
- navigator.maxTouchPoints is 0.

While the session is open:
- any-pointer: coarse is true.
- navigator.maxTouchPoints is 10.

After the session closes:
- any-pointer: coarse is false.
- navigator.maxTouchPoints is 0.

matchMedia('(pointer: fine)').matches remains true throughout.

EXPECTED RESULT

A keyboard-only portal session should not advertise touchscreen support or
change applications' touch detection.

SOFTWARE/OS VERSIONS

OS: Arch Linux
Graphics platform: Wayland
Running KWin version: 6.7.90
Installed xdg-desktop-portal-kde package: 6.7.91
Electron version: 43.7.9
Chromium version: 150.0.7871.250
Hardware: Laptop without a touchscreen

ADDITIONAL INFORMATION

The reproducer sends no input events. Starting the session is enough to trigger
the problem.

The portal creates a KWin fake-input device. FakeInputDevice::isTouch() always
returns true:
https://github.com/KDE/kwin/blob/v6.7.90/src/backends/fakeinput/fakeinputdevice.cpp

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to