aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-12-19 20:20:32 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-12-19 20:20:32 +0100
commit169bc9fa100afd01c25ec140e7dcae565920c6a4 (patch)
treef4f80e7aa6fe89a0a772f8640535ada27ed131e0
parentd9eaca6c9fa162c3b47ce61ecdeab4dc73620b0a (diff)
wl backend: add wlr_input_device_is_wl
-rw-r--r--backend/wayland/wl_seat.c4
-rw-r--r--include/backend/wayland.h1
-rw-r--r--include/wlr/backend/wayland.h6
3 files changed, 10 insertions, 1 deletions
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index 0d4ebc8d..ddee268d 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -203,6 +203,10 @@ static struct wlr_input_device_impl input_device_impl = {
.destroy = input_device_destroy
};
+bool wlr_input_device_is_wl(struct wlr_input_device *dev) {
+ return dev->impl == &input_device_impl;
+}
+
static struct wlr_input_device *allocate_device(struct wlr_wl_backend *backend,
enum wlr_input_device_type type) {
struct wlr_wl_input_device *wlr_wl_dev;
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index 5d30745e..e14e000c 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -8,7 +8,6 @@
#include <wlr/render/egl.h>
#include <wlr/backend/wayland.h>
#include <wlr/types/wlr_box.h>
-#include <wlr/types/wlr_input_device.h>
#include <wayland-util.h>
struct wlr_wl_backend {
diff --git a/include/wlr/backend/wayland.h b/include/wlr/backend/wayland.h
index bed03f51..b10ffee3 100644
--- a/include/wlr/backend/wayland.h
+++ b/include/wlr/backend/wayland.h
@@ -4,6 +4,7 @@
#include <wayland-client.h>
#include <wayland-server.h>
#include <wlr/backend.h>
+#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h>
#include <stdbool.h>
@@ -27,6 +28,11 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *backend);
bool wlr_backend_is_wl(struct wlr_backend *backend);
/**
+ * True if the given input device is a wlr_wl_input_device.
+ */
+bool wlr_input_device_is_wl(struct wlr_input_device *device);
+
+/**
* True if the given output is a wlr_wl_backend_output.
*/
bool wlr_output_is_wl(struct wlr_output *output);