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 728967 - evdev: Add libinput-specific helpers
evdev: Add libinput-specific helpers
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
wayland
Depends on:
Blocks: 724442
 
 
Reported: 2014-04-25 18:51 UTC by Carlos Garnacho
Modified: 2014-05-21 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evdev: Add evdev specific event filter function (5.86 KB, patch)
2014-04-25 18:53 UTC, Carlos Garnacho
committed Details | Review
evdev: Add function to get the libinput_device from a ClutterInputDevice (2.34 KB, patch)
2014-04-25 18:53 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-04-25 18:51:53 UTC
For Mutter, it would be interesting to reach some libinput features that aren't directly available in Clutter, and probably better stay as such. I'm attaching a couple of patches that:

1) Adds a evdev specific input filter, that allows consuming libinput_event structs
2) Adds api to fetch a libinput_device from a ClutterDeviceInput, so configuration/calibration API is made available.
Comment 1 Carlos Garnacho 2014-04-25 18:53:46 UTC
Created attachment 275156 [details] [review]
evdev: Add evdev specific event filter function

This function can be used to intercept or translate events
that are unmanaged by clutter itself.
Comment 2 Carlos Garnacho 2014-04-25 18:53:56 UTC
Created attachment 275157 [details] [review]
evdev: Add function to get the libinput_device from a ClutterInputDevice

This may be useful for deeper libinput integration that's not in the scope
of Clutter.
Comment 3 Emmanuele Bassi (:ebassi) 2014-05-13 22:11:54 UTC
Review of attachment 275156 [details] [review]:

looks reasonably good.

I guess I'll have to branch Clutter to get this new API in.

::: clutter/evdev/clutter-device-manager-evdev.c
@@ +1691,3 @@
+void
+clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
+ * Adds an event filter function.

to avoid issues in the future, you may want to add a GDestroyNotify here. though I guess this API is only ever going to be called at the C level anyway.

::: clutter/evdev/clutter-evdev.h
@@ -103,2 +103,3 @@
                                         guint32               interval);
 
+typedef enum {

minor nitpick: you could probably use a boolean and CLUTTER_EVENT_STOP and CLUTTER_EVENT_PROPAGATE instead of a new enumeration.
Comment 4 Emmanuele Bassi (:ebassi) 2014-05-13 22:13:38 UTC
Review of attachment 275157 [details] [review]:

looks good.

::: clutter/evdev/clutter-evdev.h
@@ +118,3 @@
 void clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
                                   gpointer               data);
+CLUTTER_AVAILABLE_IN_1_18

since it's new API, I'll have to branch Clutter. this will become CLUTTER_AVAILABLE_IN_1_20.

::: clutter/evdev/clutter-input-device-evdev.c
@@ +209,3 @@
+ * Returns: The libinput_device struct
+ *
+ *

same as above: this will need to be Since: 1.20.
Comment 5 Carlos Garnacho 2014-05-21 12:11:24 UTC
Attachment 275156 [details] pushed as 91ee1ce - evdev: Add evdev specific event filter function
Attachment 275157 [details] pushed as 8857b19 - evdev: Add function to get the libinput_device from a ClutterInputDevice
Comment 6 Carlos Garnacho 2014-05-21 12:17:23 UTC
(In reply to comment #3)
> Review of attachment 275156 [details] [review]:
> 
> +clutter_evdev_add_filter (ClutterEvdevFilterFunc func,
> + * Adds an event filter function.
> 
> to avoid issues in the future, you may want to add a GDestroyNotify here.
> though I guess this API is only ever going to be called at the C level anyway.

libinput is quite binding friendly, so I added the GDestroyNotify if the need ever arises, but I've left the functions remain with (skip) on introspection.

> 
> ::: clutter/evdev/clutter-evdev.h
> @@ -103,2 +103,3 @@
>                                          guint32               interval);
> 
> +typedef enum {
> 
> minor nitpick: you could probably use a boolean and CLUTTER_EVENT_STOP and
> CLUTTER_EVENT_PROPAGATE instead of a new enumeration.

Makes sense indeed :), the pushed patch does that.

>  void clutter_evdev_remove_filter (ClutterEvdevFilterFunc func,
>                                    gpointer               data);
> +CLUTTER_AVAILABLE_IN_1_18
> 
> since it's new API, I'll have to branch Clutter. this will become
> CLUTTER_AVAILABLE_IN_1_20.

Changed this and docs to "1.20"