Bug 104680

Summary: Palm rejection not working with wacom pen and touch screen
Product: Wayland Reporter: ragnarb <ragtag>
Component: XWaylandAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer, steven.nfd+bz
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description ragnarb 2018-01-17 23:19:55 UTC
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.
Comment 1 Steven D. 2018-02-04 23:54:19 UTC
This is affecting my Thinkpad Yoga 260 as well
Comment 2 GitLab Migration User 2019-05-10 15:53:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/713.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.