libinput backend: add wlr_input_device_is_libinput

This commit is contained in:
Dominique Martinet 2017-12-19 19:46:30 +01:00
parent 36d8751363
commit 3e228b0b2a
2 changed files with 5 additions and 0 deletions

View file

@ -53,6 +53,10 @@ static struct wlr_input_device *allocate_device(
return wlr_dev; 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, static void handle_device_added(struct wlr_libinput_backend *backend,
struct libinput_device *libinput_dev) { struct libinput_device *libinput_dev) {
assert(backend && libinput_dev); assert(backend && libinput_dev);

View file

@ -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); struct libinput_device *wlr_libinput_get_device_handle(struct wlr_input_device *dev);
bool wlr_backend_is_libinput(struct wlr_backend *backend); bool wlr_backend_is_libinput(struct wlr_backend *backend);
bool wlr_input_device_is_libinput(struct wlr_input_device *device);
#endif #endif