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 639830 - Use Wacom Tool Type XI property to guess device source type
Use Wacom Tool Type XI property to guess device source type
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GdkDevice
2.99.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Carlos Garnacho
: 677161 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-01-18 10:04 UTC by jessevdk@gmail.com
Modified: 2018-02-10 03:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added TOUCH and PAD source device types (1.07 KB, patch)
2011-01-18 10:04 UTC, jessevdk@gmail.com
none Details | Review
Use XIGetProperty to guess source device type for Wacom devices (3.61 KB, patch)
2011-01-18 10:05 UTC, jessevdk@gmail.com
reviewed Details | Review
updated patch (4.67 KB, patch)
2012-06-21 11:42 UTC, Matthias Clasen
none Details | Review
another update (2.50 KB, patch)
2012-08-07 04:25 UTC, Matthias Clasen
none Details | Review

Description jessevdk@gmail.com 2011-01-18 10:04:19 UTC
The Wacom Tool Type XI property exposes the type of device for Wacom devices. This information can be used to determine the type of device more reliably than matching the device name. Patches follow.
Comment 1 jessevdk@gmail.com 2011-01-18 10:04:56 UTC
Created attachment 178607 [details] [review]
Added TOUCH and PAD source device types
Comment 2 jessevdk@gmail.com 2011-01-18 10:05:05 UTC
Created attachment 178608 [details] [review]
Use XIGetProperty to guess source device type for Wacom devices

This uses the Wacom Tool Type XI property if available and falls back on
the existing code to determine the type from the device name.
Comment 3 jessevdk@gmail.com 2011-01-18 10:07:02 UTC
I'm not really sure about the additions TOUCH and PAD to GdkInputSource. At least the Wacom device I have here to test (Bamboo Fun SE) exposes four devices with the latest drivers:

Wacom Bamboo 2FG 4x5 SE Pen stylus	id: 12	type: STYLUS
Wacom Bamboo 2FG 4x5 SE Pen eraser	id: 11	type: ERASER
Wacom Bamboo 2FG 4x5 SE Finger touch	id: 14	type: TOUCH
Wacom Bamboo 2FG 4x5 SE Finger pad	id: 13	type: PAD

It would be nice to support them. I'd appreciate any feedback.
Comment 4 Peter Hutterer 2011-01-20 04:58:31 UTC
Review of attachment 178608 [details] [review]:

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

as an advanced warning, we'll be adding a few tool types to the wacom driver in the forseeable future (e.g. AIRBRUSH). certainly easy to add with this code
Comment 5 Peter Hutterer 2011-01-20 05:11:27 UTC
Review of attachment 178607 [details] [review]:

with the upcoming touch device support I'd be careful about naming it TOUCH vs TOUCHPAD, they're not always the same. wacom devices are special in that some of them are more like a touchpad (bamboo) and some of them more like a direct-input touch device (tablet PC mounted serial devices). given that a touchpad is usually a simple pointer device though, i recommend changing the comment to "device is a touch device"
Comment 6 jessevdk@gmail.com 2011-01-20 09:55:47 UTC
I'm a bit fuzzy on the naming of the device myself. I don't really know what a PAD device is for example (or the exact difference between a TOUCH_PAD, PAD and TOUCH devices).
Comment 7 Matthias Clasen 2012-03-05 03:44:32 UTC
We've now added GDK_SOURCE_TOUCHSCREEN and GDK_SOURCE_TOUCHPAD for direct and indirect touch devices - does that cover the Wacom cases ?
Comment 8 jessevdk@gmail.com 2012-03-05 08:41:40 UTC
I suppose, although I wonder if it would be interesting to also add things like ERASER?
Comment 9 Matthias Clasen 2012-06-21 11:42:10 UTC
Created attachment 216908 [details] [review]
updated patch

Here is an updated patch (untested).
Comment 10 Matthias Clasen 2012-06-21 11:42:38 UTC
*** Bug 677161 has been marked as a duplicate of this bug. ***
Comment 11 Matthias Clasen 2012-06-21 11:58:06 UTC
Unfortunately, I don't have any wacom (or other) touch devices around to test this with. Peter, would it be possible for you to test this ?
Comment 12 Matthias Clasen 2012-06-21 14:32:49 UTC
<mclasen> ofourdan: are the touch devices correctly classified wrt to direct vs indirect touch ?
<ofourdan> what does "indirect/direct" touch means in this context?
<ajax> touchscreen vs touchpad.
<ofourdan> well if that's the case then it's not correct
<ajax> iirc.  direct is "warp pointer to here first", indirect is just rel motion.
<ofourdan> the pad is said to be "indirect touch" whereas it's just buttons
<ofourdan> the finger touch is said to be direct, but it's atablet, not atouch screen
<ofourdan> the finger touch on the tablet would be indirect, unless this is a screentablet (which is not the case here)
Comment 13 Carlos Garnacho 2012-06-21 16:12:02 UTC
maybe direct vs indirect should be set depending on the device having absolute or relative mode? (although that could change at runtime, and ::input-source is construct-only, hrm...)
Comment 14 Matthias Clasen 2012-06-23 10:32:43 UTC
Peter, do you have a table mapping 'Wacom Tool Type' values to devices types (keyboard/mouse/pen/eraser/direct touch/indirect touch) ?
Comment 15 Peter Hutterer 2012-06-25 01:35:34 UTC
Code for setting type is here:
http://linuxwacom.git.sourceforge.net/git/gitweb.cgi?p=linuxwacom/xf86-input-wacom;a=blob;f=src/wcmConfig.c;h=e7fea5b4243f8618b8a1305faa137dd340c57436;hb=HEAD#l135
Parameter passed in is the Option "Type" value from the config (automatically filled in default configuration).

Values for the type name/property are:
"STYLUS" - for type stylus, i.e. any pen tool
"ERASER" - for the eraser device (if available). X device may sometimes be there even if the physical stylus doesn't have one
"CURSOR" - for the puck device (wacom mouse)
"PAD" - for the physical tablet, i.e. the buttons and scrollwheels/rings only
"TOUCH" - for touch devices. in some configurations, mainly Bamboos. the touch device is actually driven by synaptics so you may not see this tool type
these are the only values currently used by the driver, you won't see the XI_MOUSE, XI_TOUCHPAD, etc. values.

mapping direct/indirect is harder, but we do switch the valuator mode of the device when the mode changes in the driver. so XIQueryDevice's XIValuatorClassInfo contains that bit. but that may (and will) change, it depends on gsettings.

the only way to really get whether it's a direct input device is querying libwacom_device_is_builtin() and ignoring those users that set the device to relative mode despite being a built-in one :)
Comment 16 Matthias Clasen 2012-08-07 04:25:16 UTC
Created attachment 220507 [details] [review]
another update

Here is another iteration.
This patch looks at the valuator mode to decide direct vs indirect touch.
Am I right that a 'pad' should be considered a keyboard here ?
Does it give me key or button events ?

Olivier, if you could test this patch one more time, that would be fantastic.
Comment 17 Peter Hutterer 2012-08-10 07:42:14 UTC
Review of attachment 220507 [details] [review]:

untested, but it looks correct. I would change the commit message though, this patch adds a valuator mode check, not much related to tool type property checking.
Comment 18 Matthias Clasen 2018-02-10 03:42:24 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.