On 01/06/2016 20:43, Giulio Camuffo wrote:
Instead add callbacks to the drm and fbdev backends and pass that to
the input backens so that when a new device needs to be configured
that is called and the compositor can configure it.

Signed-off-by: Giulio Camuffo <[email protected]>
---
 Makefile.am            |  3 ++-
 src/compositor-drm.c   |  3 ++-
 src/compositor-drm.h   | 11 +++++++++++
 src/compositor-fbdev.c |  3 ++-
 src/compositor-fbdev.h | 11 +++++++++++
 src/compositor-rpi.c   |  2 +-
 src/libinput-device.c  | 31 +------------------------------
 src/libinput-device.h  |  2 ++
 src/libinput-seat.c    |  7 ++++++-
 src/libinput-seat.h    |  9 ++++++++-
 src/main.c             | 27 +++++++++++++++++++++++++++
 11 files changed, 73 insertions(+), 36 deletions(-)


Just one comment (applying three times to this patch).


> [snip]
diff --git a/src/compositor-drm.h b/src/compositor-drm.h
index 3f150db..1266031 100644
--- a/src/compositor-drm.h
+++ b/src/compositor-drm.h
@@ -36,6 +36,8 @@ extern "C" {

 #define WESTON_DRM_BACKEND_CONFIG_VERSION 1

+struct libinput_device;
+

I guess the idea is to avoid #include <libinput.h> here. Is that really a problem? Just add it to the Requires.private: in weston.pc. Actually, for libweston, libinput *must* be in libweston.pc Requires.private, otherwise you cannot link to libweston statically.


 enum weston_drm_backend_output_mode {
        /** The output is disabled */
        WESTON_DRM_BACKEND_OUTPUT_OFF,
@@ -117,6 +119,15 @@ struct weston_drm_backend_config {
                                    bool use_current_mode,
                                    const char *name,
                                    struct weston_drm_backend_output_config 
*output_config);
+
+       /** Callback used to configure input devices.
+        *
+        * This function will be called by the backend when a new input device
+        * needs to be configured.
+        * If NULL the device will use the default configuration.
+        */
+       void (*configure_device)(struct weston_compositor *compositor,
+                                struct libinput_device *device);
        bool use_current_mode;
 };

[snip]

The rest looks good.

Cheers,

--

Quentin “Sardem FF7” Glidic
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to