GNOME Bugzilla – Bug 740759
Add getters for input device vendor/product IDs
Last modified: 2015-01-09 16:03:37 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.
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.
Created attachment 291559 [details] [review] x11: Set vendor/product IDs on input devices This is fetched from XInput device properties
Created attachment 291560 [details] [review] evdev: Set vendor/product IDs on input devices This is fetched right away from libinput API.
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.
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()?
Review of attachment 291560 [details] [review]: looks okay.
(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.
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.
Created attachment 291663 [details] [review] x11: Set vendor/product IDs on input devices This is fetched from XInput device properties
Created attachment 291664 [details] [review] evdev: Set vendor/product IDs on input devices This is fetched right away from libinput API.
Review of attachment 291662 [details] [review]: okay.
Review of attachment 291663 [details] [review]: looks good.
Review of attachment 291664 [details] [review]: okay.
just remember to commit to master, not clutter-1.22 :-)
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