aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-19 22:53:08 +0100
committerGitHub <noreply@github.com>2017-12-19 22:53:08 +0100
commit1a96ce0c53c84295d33b143e1b6cf02cb7017d50 (patch)
treec19713e52bb8931c9a5116e745104458bf5e4f29 /backend/x11
parent36d875136354b0f0438b1fe89d5ea897b113bd24 (diff)
parentfcd7062542bec6f9ab247dbc63c6eead457006bf (diff)
Merge pull request #505 from martinetd/io_is_foo
Add wlr_input_device_is_foo and wlr_output_is_bar functions
Diffstat (limited to 'backend/x11')
-rw-r--r--backend/x11/backend.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index f6f9cfa8..d2690342 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -25,6 +25,7 @@
static struct wlr_backend_impl backend_impl;
static struct wlr_output_impl output_impl;
+static struct wlr_input_device_impl input_device_impl = { 0 };
static uint32_t xcb_button_to_wl(uint32_t button) {
switch (button) {
@@ -328,12 +329,12 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
}
wlr_input_device_init(&x11->keyboard_dev, WLR_INPUT_DEVICE_KEYBOARD,
- NULL, "X11 keyboard", 0, 0);
+ &input_device_impl, "X11 keyboard", 0, 0);
wlr_keyboard_init(&x11->keyboard, NULL);
x11->keyboard_dev.keyboard = &x11->keyboard;
wlr_input_device_init(&x11->pointer_dev, WLR_INPUT_DEVICE_POINTER,
- NULL, "X11 pointer", 0, 0);
+ &input_device_impl, "X11 pointer", 0, 0);
wlr_pointer_init(&x11->pointer, NULL);
x11->pointer_dev.pointer = &x11->pointer;
@@ -401,3 +402,11 @@ static struct wlr_output_impl output_impl = {
.make_current = output_make_current,
.swap_buffers = output_swap_buffers,
};
+
+bool wlr_output_is_x11(struct wlr_output *wlr_output) {
+ return wlr_output->impl == &output_impl;
+}
+
+bool wlr_input_device_is_x11(struct wlr_input_device *wlr_dev) {
+ return wlr_dev->impl == &input_device_impl;
+}