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 740759 - Add getters for input device vendor/product IDs
Add getters for input device vendor/product IDs
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
1.20.x
Other Linux
: Normal enhancement
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks: 739397
 
 
Reported: 2014-11-26 15:16 UTC by Carlos Garnacho
Modified: 2015-01-09 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
input-device: Add vendor/product ID properties and getters (5.69 KB, patch)
2014-11-26 15:17 UTC, Carlos Garnacho
reviewed Details | Review
x11: Set vendor/product IDs on input devices (2.82 KB, patch)
2014-11-26 15:17 UTC, Carlos Garnacho
reviewed Details | Review
evdev: Set vendor/product IDs on input devices (1.09 KB, patch)
2014-11-26 15:17 UTC, Carlos Garnacho
reviewed Details | Review
input-device: Add vendor/product ID properties and getters (6.03 KB, patch)
2014-11-27 15:16 UTC, Carlos Garnacho
committed Details | Review
x11: Set vendor/product IDs on input devices (3.19 KB, patch)
2014-11-27 15:16 UTC, Carlos Garnacho
committed Details | Review
evdev: Set vendor/product IDs on input devices (1.90 KB, patch)
2014-11-27 15:16 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-11-26 15:16:34 UTC
I'm attaching some patches to add vendor/product-id properties to ClutterInputDevice, these are filled in so far for the x11 and evdev input backends. For wayland it's still kind of an open question, I filed bug #740758 to add similar api to Gdk, the same ideas wrt wayland apply here I think.
Comment 1 Carlos Garnacho 2014-11-26 15:17:21 UTC
Created attachment 291558 [details] [review]
input-device: Add vendor/product ID properties and getters

This may be useful when trying to identify the device across sessions.
Comment 2 Carlos Garnacho 2014-11-26 15:17:25 UTC
Created attachment 291559 [details] [review]
x11: Set vendor/product IDs on input devices

This is fetched from XInput device properties
Comment 3 Carlos Garnacho 2014-11-26 15:17:30 UTC
Created attachment 291560 [details] [review]
evdev: Set vendor/product IDs on input devices

This is fetched right away from libinput API.
Comment 4 Emmanuele Bassi (:ebassi) 2014-11-26 15:51:52 UTC
Review of attachment 291558 [details] [review]:

the question is: are these IDs stable? should they be a string, instead of an ID?

I don't have a particular objection to the API.

::: clutter/clutter-input-device.h
@@ +136,3 @@
                                                                  guint              *evdev_keycode);
 
+CLUTTER_AVAILABLE_IN_1_20

this needs to be CLUTTER_AVAILABLE_IN_1_22.

let me branch Clutter and push the version macros…

@@ +138,3 @@
+CLUTTER_AVAILABLE_IN_1_20
+guint                   clutter_input_device_get_vendor_id      (ClutterInputDevice *device);
+CLUTTER_AVAILABLE_IN_1_20

same as above.
Comment 5 Emmanuele Bassi (:ebassi) 2014-11-26 15:52:38 UTC
Review of attachment 291559 [details] [review]:

::: clutter/x11/clutter-device-manager-xi2.c
@@ +249,3 @@
+  Atom type;
+
+  rc = XIGetProperty (backend_x11->xdpy,

do we need to set up the error trap around XIGetProperty()?
Comment 6 Emmanuele Bassi (:ebassi) 2014-11-26 15:52:53 UTC
Review of attachment 291560 [details] [review]:

looks okay.
Comment 7 Carlos Garnacho 2014-11-27 15:15:45 UTC
(In reply to comment #4)
> Review of attachment 291558 [details] [review]:
> 
> the question is: are these IDs stable? should they be a string, instead of an
> ID?

Yeah, same question was brought up in the gtk+ bug as well. I agree an string should be more future proof although on usb vid/pid are restricted to 16 bits, I've gone for %.4x to represent these in the end though, as it's what's more recogniceable on eg. lsusb output.

> +CLUTTER_AVAILABLE_IN_1_20
> 
> this needs to be CLUTTER_AVAILABLE_IN_1_22.
> 
> let me branch Clutter and push the version macros…

Thanks :), I'm attaching some new patches that still have IN_1_20, that will of course be changed before pushing

(In reply to comment #5)
> Review of attachment 291559 [details] [review]:
> 
> ::: clutter/x11/clutter-device-manager-xi2.c
> @@ +249,3 @@
> +  Atom type;
> +
> +  rc = XIGetProperty (backend_x11->xdpy,
> 
> do we need to set up the error trap around XIGetProperty()?

Oops yeah, would be wise, might always be called untimely at some point.
Comment 8 Carlos Garnacho 2014-11-27 15:16:37 UTC
Created attachment 291662 [details] [review]
input-device: Add vendor/product ID properties and getters

This may be useful when trying to identify the device across sessions.
Comment 9 Carlos Garnacho 2014-11-27 15:16:42 UTC
Created attachment 291663 [details] [review]
x11: Set vendor/product IDs on input devices

This is fetched from XInput device properties
Comment 10 Carlos Garnacho 2014-11-27 15:16:47 UTC
Created attachment 291664 [details] [review]
evdev: Set vendor/product IDs on input devices

This is fetched right away from libinput API.
Comment 11 Emmanuele Bassi (:ebassi) 2015-01-08 16:05:00 UTC
Review of attachment 291662 [details] [review]:

okay.
Comment 12 Emmanuele Bassi (:ebassi) 2015-01-08 16:06:09 UTC
Review of attachment 291663 [details] [review]:

looks good.
Comment 13 Emmanuele Bassi (:ebassi) 2015-01-08 16:06:36 UTC
Review of attachment 291664 [details] [review]:

okay.
Comment 14 Emmanuele Bassi (:ebassi) 2015-01-08 16:07:39 UTC
just remember to commit to master, not clutter-1.22 :-)
Comment 15 Carlos Garnacho 2015-01-09 16:03:18 UTC
Pushed everything to master :).

Attachment 291662 [details] pushed as 78fdefc - input-device: Add vendor/product ID properties and getters
Attachment 291663 [details] pushed as c0d5d58 - x11: Set vendor/product IDs on input devices
Attachment 291664 [details] pushed as f5f523c - evdev: Set vendor/product IDs on input devices