diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2017-12-19 19:46:30 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2017-12-19 20:13:49 +0100 |
commit | 3e228b0b2ac6fbeee544764aa1c3aa1e7e501af1 (patch) | |
tree | 4a7a636510c46915562728ad146bda4ba85e8486 | |
parent | 36d875136354b0f0438b1fe89d5ea897b113bd24 (diff) |
libinput backend: add wlr_input_device_is_libinput
-rw-r--r-- | backend/libinput/events.c | 4 | ||||
-rw-r--r-- | include/wlr/backend/libinput.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c index c14aef01..758a9f25 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -53,6 +53,10 @@ static struct wlr_input_device *allocate_device( return wlr_dev; } +bool wlr_input_device_is_libinput(struct wlr_input_device *wlr_dev) { + return wlr_dev->impl == &input_device_impl; +} + static void handle_device_added(struct wlr_libinput_backend *backend, struct libinput_device *libinput_dev) { assert(backend && libinput_dev); diff --git a/include/wlr/backend/libinput.h b/include/wlr/backend/libinput.h index 95b8829d..af873628 100644 --- a/include/wlr/backend/libinput.h +++ b/include/wlr/backend/libinput.h @@ -12,5 +12,6 @@ struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display, struct libinput_device *wlr_libinput_get_device_handle(struct wlr_input_device *dev); bool wlr_backend_is_libinput(struct wlr_backend *backend); +bool wlr_input_device_is_libinput(struct wlr_input_device *device); #endif |