After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763092 - Mapping Wacom Intuos4 keys using on-screen overlay not possible
Mapping Wacom Intuos4 keys using on-screen overlay not possible
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: mouse
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-04 12:05 UTC by Vladimir Savic
Modified: 2016-03-19 12:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mouse, common: Fix Wacom buttons not receiving events (12.74 KB, patch)
2016-03-16 12:32 UTC, Bastien Nocera
committed Details | Review

Description Vladimir Savic 2016-03-04 12:05:47 UTC
I'm using Wacom Intuos4 tablet, which I can confirm by:

$ lsusb | grep Wacom
Bus 002 Device 005: ID 056a:00b9 Wacom Co., Ltd PTK-640 [Intuos4 (6x9)]

Distribution Antergos (which is Arch based and therefore as close to vanilla packages as possible) with:

extra/xf86-input-wacom 0.32.0-1 [installed]
extra/libwacom 0.18-1 [installed]
(not sure if following informations are relevant, but I have included them anyway)
extra/xorg-server 1.18.1-3 (xorg) [installed]
extra/xf86-input-evdev 2.10.1-3 (xorg-drivers xorg) [installed]
extra/nvidia-340xx 340.96-6 [installed]

A few more, possibly useful informations:
$ dmesg |grep wacom
[   11.809476] wacom 0003:056A:00B9.0008: hidraw5: USB HID v1.00 Mouse [Tablet PTK-640] on usb-0000:00:02.0-7/input0
$ dmesg |grep Wacom
[   11.808035] input: Wacom Intuos4 6x9 Pen as /devices/pci0000:00/0000:00:02.0/usb2/2-7/2-7:1.0/0003:056A:00B9.0008/input/input8
[   11.808224] input: Wacom Intuos4 6x9 Pad as /devices/pci0000:00/0000:00:02.0/usb2/2-7/2-7:1.0/0003:056A:00B9.0008/input/input10

$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ Logitech M705                           	id=9	[slave  pointer  (2)]
⎜   ↳ RAPOO RAPOO 5G Wireless Device          	id=11	[slave  pointer  (2)]
⎜   ↳ Wacom Intuos4 6x9 Pad pad               	id=12	[slave  pointer  (2)]
⎜   ↳ Wacom Intuos4 6x9 Pen stylus            	id=13	[slave  pointer  (2)]
⎜   ↳ Wacom Intuos4 6x9 Pen eraser            	id=16	[slave  pointer  (2)]
⎜   ↳ Wacom Intuos4 6x9 Pen cursor            	id=17	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ↳ Burr-Brown from TI               USB Audio CODEC 	id=8	[slave  keyboard (3)]
    ↳ RAPOO RAPOO 5G Wireless Device          	id=10	[slave  keyboard (3)]
    ↳ UVC Camera (046d:0825)                  	id=14	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=15	[slave  keyboard (3)]

$ gsettings get org.gnome.settings-daemon.plugins.gsdwacom active
true

$ i4oled-gui
for setting up pad LED icons works, so I guess the pad itself is initialised correctly. Control Center's Wacom setup utility didn't work even prior to installing that small helper app.

No special xorg.conf setings for identifing Wacom tablet.

Everything works as expected when set from Wacom control panel, except button mapping. I get that nicely drawn overlay with correct button layout, but nothing if functional there, except Edit button and Esc key. When I click at it, app still doesn't register any button as pressed. Maybe I'm doing something wrong or I simply can not figure out how it works.

Cheers,
Vlada
Comment 1 Bastien Nocera 2016-03-10 17:52:22 UTC
I can reproduce the problem with GNOME 3.18, but not with the latest 3.19.x versions. It seems however to be a knock-on effect of removing some older code in the mouse plugin.

Running:
gsettings set org.gnome.settings-daemon.plugins.mouse active false
works around the problem for me.

The only relevant debug from the mouse plugin is:
(gnome-settings-daemon:26333): mouse-plugin-DEBUG: setting handedness on Wacom Intuos4 6x9 Pen cursor
(gnome-settings-daemon:26333): mouse-plugin-DEBUG: setting motion on Wacom Intuos4 6x9 Pen cursor
(gnome-settings-daemon:26333): mouse-plugin-DEBUG: Setting accel 10/1, threshold 1 for device 'Wacom Intuos4 6x9 Pen cursor'
Comment 2 Bastien Nocera 2016-03-10 18:29:41 UTC
Apparently it's a problem in synaptics_is_present()...
Comment 3 Bastien Nocera 2016-03-10 19:45:10 UTC
I'm at a loss here. When synaptics_is_present() is called, and the wacom pad device is opened then closed at:
https://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-input-helper.c?h=gnome-3-18#n212
I don't receive any more events from the device through XIGrabButton()...

I can reproduce this on an updated Fedora 23 with:
xorg-x11-drv-wacom-0.30.0-3.fc23.x86_64
Comment 4 Bastien Nocera 2016-03-11 09:19:19 UTC
(In reply to Bastien Nocera from comment #3)
> I'm at a loss here. When synaptics_is_present() is called, and the wacom pad
> device is opened then closed at:
> https://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-
> input-helper.c?h=gnome-3-18#n212
> I don't receive any more events from the device through XIGrabButton()...
> 
> I can reproduce this on an updated Fedora 23 with:
> xorg-x11-drv-wacom-0.30.0-3.fc23.x86_64

Not calling XCloseDevice() fixes the problem, which leads me to believe there's a file descriptor refcounting problem.
Comment 5 Bastien Nocera 2016-03-11 09:41:12 UTC
Opened https://bugs.freedesktop.org/show_bug.cgi?id=94487 with a test case.
Comment 6 Vladimir Savic 2016-03-11 11:02:49 UTC
Thank you for looking at this bug. I'll subscribe myself to that freedesktop bug and watch how things are developing there.

Regards,
Vlada
Comment 7 Bastien Nocera 2016-03-16 12:12:53 UTC
It is a GNOME bug after all, caused by less than ideal API :/
Comment 8 Bastien Nocera 2016-03-16 12:32:17 UTC
Created attachment 324094 [details] [review]
mouse, common: Fix Wacom buttons not receiving events

When configuring mice and touchpads, we might stumble upon a Wacom pad
device. To check whether it's a synaptics device, we open the device,
get the properties, and close it back up.

But when we close it, we end up releasing whatever grab the wacom plugin
might have had on the pad buttons:

           When a client makes an XCloseDevice request, any active grabs
           that the client has on the device are released.  Any event
           selections that the client has are deleted, as well as any
           passive grabs. If the requesting client is the last client
           accessing the device, the server may disable all access by X to
           the device.

As we cannot change that behaviour, we'll use a call that doesn't
require opening the device so we don't have to close it.

See https://bugs.freedesktop.org/show_bug.cgi?id=94487
Comment 9 Peter Hutterer 2016-03-17 00:20:20 UTC
Comment on attachment 324094 [details] [review]
mouse, common: Fix Wacom buttons not receiving events

Acked-by: Peter Huttere <peter.hutterer@who-t.net>


Just as a warning: when you're switching from XI1 properties to XI2 propertes watch out for 32-bit properties. When retrieved via XIGetProperty() they are actually uint32_t, not longs, so you can use them directly and don't have to do the 8-byte dance.
Comment 10 Bastien Nocera 2016-03-17 11:23:52 UTC
Pushed as-is, it's a copy of the "is libinput" function, and doesn't exist in GNOME 3.20 anymore.

Attachment 324094 [details] pushed as 552258b - mouse, common: Fix Wacom buttons not receiving events
Comment 11 Vladimir Savic 2016-03-19 10:53:47 UTC
Thanks for the push! Will it make it into gnome 3.20? I can follow a link to a commit directly from this bug report, but, strangly, I don't see "mouse, common: Fix Wacom buttons not receiving events" in gnome-settings-daemon cumulative commit log.

Thanks again,
Vlada
Comment 12 Vladimir Savic 2016-03-19 10:59:43 UTC
My bad! I spoke three minutes to soon... I failed to read your comment correctly. So, this goes into bugfix release of 3.18, but in 3.20 it is not applicable, because 3.20 works through other mechanisms. Unfortunately, I have no means to test 3.20 currently, so I must believe you that it will work. ;)

Sorry for the noise.
Vlada
Comment 13 Bastien Nocera 2016-03-19 12:42:26 UTC
The code that got fixed doesn't exist in 3.20. Either have your distribution package 3.18.3 or use 3.20. gnome-settings-daemon 3.18.3 is already in Fedora updates.