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

            Bug ID: 525409
           Summary: Drawing tablet pen is always mapped to internal eDP
                    display; configured outputName is ignored.
    Classification: Plasma
           Product: kwin
      Version First 6.7.4
       Reported In:
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: multi-screen
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

**Summary**

[Wayland] Drawing tablet pen is always mapped to internal eDP display;
configured `outputName` is ignored

**Description**

On a multi-monitor Wayland setup, the pen of my Huion RDS-220 pen display is
always mapped to the laptop's internal eDP-1 display instead of the RDS-220
display.

KDE System Settings correctly shows the tablet as mapped to the RDS-220. KWin's
live D-Bus InputDevice object also reports `outputName = "DP-1"`, which is the
output connected to the RDS-220.

However, actual pen input is mapped to eDP-1.

The mapping onto eDP-1 itself appears geometrically correct: placing the pen at
the upper-left of the RDS-220 places the cursor at the upper-left of the laptop
display, etc. The problem appears specifically to be selection of the wrong
output.

Changing `outputName` live over KWin's D-Bus interface does not change the
actual output used by the pen.

**Hardware / display layout**

Tablet display:

* Huion RDS-220
* Input device: `Huion Tablet_RDS-220 Pen`
* USB ID: `256c:2001`
* libinput device: `/dev/input/event21`
* Physical tablet size reported by libinput: approximately 160x100 mm

Displays:

```
DP-1
UUID: 3d9f1755-41d8-4ee6-a811-3d3100a9c191
Geometry: 0,1440 2560x1440
Scale: 1
This is the Huion RDS-220.

HDMI-A-1
UUID: bb9c752f-3f08-4a26-a498-35bc60e15c14
Geometry: 0,0 2560x1440
Scale: 1

eDP-1
UUID: 0fb5e6d1-5a0b-425c-a27a-f43ed4b2e1ac
Geometry: 2560,0 2560x1440
Scale: 1
This is the laptop's internal display.
```

**Software**

* Manjaro Linux
* KDE Plasma 6.7.4
* KWin 6.7.4
* Wayland session
* libinput 1.31.3

**Steps to reproduce**

1. Connect the Huion RDS-220 in a three-monitor Wayland configuration as
described above.
2. Open System Settings -> Input & Output -> Drawing Tablet.
3. Select `Huion Tablet_RDS-220 Pen`.
4. Set "Map to screen" to RDS-220 / DP-1.
5. Move the pen over the RDS-220.

**Observed result**

The cursor appears and moves on the laptop's internal eDP-1 display.

The mapping onto eDP-1 is normalized correctly. For example, the upper-left of
the tablet maps to the upper-left of eDP-1 and the lower-right maps
correspondingly.

**Expected result**

The pen should be mapped to DP-1, the RDS-220 display selected in System
Settings.

**KWin configuration**

`~/.config/kcminputrc` contains:

```
[Libinput][9580][8193][Huion Tablet_RDS-220 Pen]
CalibrationMatrix=1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1
OutputArea=0,0,1,1.1
OutputUuid=3d9f1755-41d8-4ee6-a811-3d3100a9c191
```

The UUID is the correct UUID for DP-1.

**Live KWin InputDevice state**

Querying:

```
busctl --user introspect \
  org.kde.KWin \
  /org/kde/KWin/InputDevice/event21 \
  org.kde.KWin.InputDevice
```

shows, among other properties:

```
calibrationMatrix = "1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1"
enabled = true
inputArea = 0 0 1 1
isVirtual = false
mapToWorkspace = false
name = "Huion Tablet_RDS-220 Pen"
outputArea = 0 0 1 1.1
outputName = "DP-1"
product = 8193
size = 159.839 99.8994
```

Thus KWin's live device object also reports the expected `outputName = "DP-1"`.

**Changing outputName at runtime**

I tested changing the live property directly:

```
busctl --user set-property \
  org.kde.KWin \
  /org/kde/KWin/InputDevice/event21 \
  org.kde.KWin.InputDevice \
  outputName s "HDMI-A-1"
```

Reading the property afterwards confirms:

```
s "HDMI-A-1"
```

However, the actual pen cursor remains mapped to eDP-1.

Changing it back to `DP-1` likewise changes the D-Bus property but not the
actual pen mapping.

I also tested:

```
mapToWorkspace = true
```

through the same D-Bus InputDevice interface. The property changes
successfully, but the pen remains mapped exclusively to eDP-1.

**Test with eDP-1 disabled**

I disabled the internal display with:

```
kscreen-doctor output.eDP-1.disable
```

while DP-1 and HDMI-A-1 remained active.

Pen input then produced no visible cursor/input on either remaining display. It
appears that KWin continued mapping the tablet into the now-disabled eDP-1
output rather than remapping it to DP-1.

Re-enabling eDP-1 restored the previous behavior.

**Raw libinput test**

The native pen produces sensible absolute coordinates through libinput:

```
sudo libinput debug-events --device /dev/input/event21
```

Example positions included approximately:

```
12.46 / 9.14
33.41 / 9.55
17.12 / 88.87
4.91 / 93.73
154.47 / 90.02
```

for a tablet reported as approximately 160x100 mm.

Thus the kernel/libinput input coordinates appear to traverse the tablet area
correctly.

**KWin device enumeration**

KWin sees only the expected native RDS-220 interfaces:

```
event21  "Huion Tablet_RDS-220 Pen"
event22  "Huion Tablet_RDS-220"
event23  "Huion Tablet_RDS-220 Keyboard"
```

There is no second native tablet pen object in KWin.

**Huion proprietary driver**

The Huion proprietary Linux driver (`huiontablet 15.0.0.162-1`) was initially
installed and running. It creates additional virtual Huion input devices.

For troubleshooting, the Huion software was completely exited. `ps` confirmed
that neither `huionCore` nor `huiontablet` was running, and `libinput
list-devices` then contained only the native RDS-220 interfaces listed above.

The problem described here occurs with the proprietary Huion software stopped
and the native `Huion Tablet_RDS-220 Pen` device handled by libinput/KWin.

**Additional observation**

With the proprietary Huion software stopped, KDE System Settings contains only
the native RDS-220 tablet rather than the additional virtual Huion devices.

System Settings reports that this native device is mapped to the RDS-220. This
agrees with both `kcminputrc` and KWin's live `outputName = "DP-1"` property,
but disagrees with actual behavior.

In short, the configuration appears correct at all inspected levels, but KWin
maps the tablet to eDP-1 regardless of the configured/live `outputName`.

My configuration:
Operating System: Manjaro Linux 
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.2
Kernel Version: 7.1.13-2-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 5900HX with Radeon Graphics
Memory: 32 GiB of RAM (30,7 GiB usable)
Graphics Processor 1: AMD Radeon Graphics
Graphics Processor 2: AMD Radeon RX 6800M
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Strix G513QY_G513QY
System Version: 1.0

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

Reply via email to