aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-12-19 20:12:04 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-12-19 20:16:12 +0100
commit995383b0490401494bf4999f46428b319e781820 (patch)
tree6d94aa108190deb91950f740ef2ffc43fa0d3642
parentbe95147385b961c9734d2c4406df90d93f3d45a9 (diff)
headless backend: add wlr_input_device_is_headless
-rw-r--r--backend/headless/input_device.c4
-rw-r--r--include/wlr/backend/headless.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c
index 05def775..5c62e87f 100644
--- a/backend/headless/input_device.c
+++ b/backend/headless/input_device.c
@@ -19,6 +19,10 @@ static struct wlr_input_device_impl input_device_impl = {
.destroy = input_device_destroy,
};
+bool wlr_input_device_is_headless(struct wlr_input_device *wlr_dev) {
+ return wlr_dev->impl == &input_device_impl;
+}
+
struct wlr_input_device *wlr_headless_add_input_device(
struct wlr_backend *wlr_backend, enum wlr_input_device_type type) {
struct wlr_headless_backend *backend =
diff --git a/include/wlr/backend/headless.h b/include/wlr/backend/headless.h
index 68ad84da..2c25beb0 100644
--- a/include/wlr/backend/headless.h
+++ b/include/wlr/backend/headless.h
@@ -10,5 +10,6 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *backend,
struct wlr_input_device *wlr_headless_add_input_device(
struct wlr_backend *backend, enum wlr_input_device_type type);
bool wlr_backend_is_headless(struct wlr_backend *backend);
+bool wlr_input_device_is_headless(struct wlr_input_device *device);
#endif