From 605f9e918154a49e193d3d14752aa58998cde9f0 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Fri, 1 Dec 2023 22:13:07 +0100 Subject: [PATCH] seat: initialize tablet tool or pad Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com> --- src/seat.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/seat.c b/src/seat.c index 64447df4..ce78d479 100644 --- a/src/seat.c +++ b/src/seat.c @@ -9,6 +9,7 @@ #include #include #include "common/mem.h" +#include "input/drawing_tablet.h" #include "input/input.h" #include "input/keyboard.h" #include "input/key-state.h" @@ -254,6 +255,16 @@ new_touch(struct seat *seat, struct wlr_input_device *dev) return input; } +static struct input * +new_tablet(struct seat *seat, struct wlr_input_device *dev) +{ + struct input *input = znew(*input); + input->wlr_input_device = dev; + drawing_tablet_setup_handlers(seat, dev); + + return input; +} + static void seat_update_capabilities(struct seat *seat) { @@ -306,6 +317,10 @@ new_input_notify(struct wl_listener *listener, void *data) case WLR_INPUT_DEVICE_TOUCH: input = new_touch(seat, device); break; + case WLR_INPUT_DEVICE_TABLET_PAD: + case WLR_INPUT_DEVICE_TABLET_TOOL: + input = new_tablet(seat, device); + break; default: wlr_log(WLR_INFO, "unsupported input device"); return;