Palm rejection not working with wacom pen and touch screen
Submitted by ragnarb
Assigned to Wayland bug list
Link to original bug (#104680)
Description
On my ThinkPad S1 Yoga (model nr. 20DLCTO1WW) running Ubuntu Gnome 17.10, with Wayland and libinput 1.8.2, which has both a Wacom EMR (passive) stylus and a touch screen.
The stylus is detected when it comes within 1 cm or so from the screen, and ideally the touch screen should be disabled at this point, so you can rest your hand on the screen while writing or drawing, without causing accidental touches.
There was a somewhat hacky python script that solved this, that I contributed to ( https://github.com/ragtag/spin ), but this no longer works as the xinput command used to detect pen proximity no longer works.
"xinput --list" returns:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ xwayland-pointer:13 id=6 [slave pointer (2)]
⎜ ↳ xwayland-relative-pointer:13 id=7 [slave pointer (2)]
⎜ ↳ xwayland-stylus:13 id=10 [slave pointer (2)]
⎜ ↳ xwayland-eraser:13 id=11 [slave pointer (2)]
⎜ ↳ xwayland-cursor:13 id=12 [slave pointer (2)]
⎜ ↳ xwayland-touch:13 id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ xwayland-keyboard:13 id=8 [slave keyboard (3)]
But when running 'xinput query-state "xwayland-stylus:13"', none of the values change, including Proximity, which is what the Python was using to know when to disable the touchscreen.
"sudo libinput debug-events" does detect the pen perfectly, including noting proximity-in and proximity-out.
I originally wanted to update the spin Python script to work with Wayland, but quickly found that much of what it does, such as automatic screen rotation, was already implemented and working, so it would be great to see these final little issues fixed too. I originally posted a bug report on it here https://github.com/linuxwacom/wacom-hid-descriptors/issues/18
That said, if this is something that will or should not be fixed in XWayland, I would love to get a pointer in the right direction for how to correctly handle proximity detection from Python, so I can re-write spin to work correctly in Wayland.