aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/tablet.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/tablet.c')
-rw-r--r--sway/input/tablet.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/input/tablet.c b/sway/input/tablet.c
index 92ede3fa..a62e77ec 100644
--- a/sway/input/tablet.c
+++ b/sway/input/tablet.c
@@ -1,6 +1,6 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <stdlib.h> 2#include <stdlib.h>
3#include <wlr/backend/libinput.h> 3#include <wlr/config.h>
4#include <wlr/types/wlr_tablet_v2.h> 4#include <wlr/types/wlr_tablet_v2.h>
5#include <wlr/types/wlr_tablet_tool.h> 5#include <wlr/types/wlr_tablet_tool.h>
6#include <wlr/types/wlr_tablet_pad.h> 6#include <wlr/types/wlr_tablet_pad.h>
@@ -9,6 +9,10 @@
9#include "sway/input/seat.h" 9#include "sway/input/seat.h"
10#include "sway/input/tablet.h" 10#include "sway/input/tablet.h"
11 11
12#if WLR_HAS_LIBINPUT_BACKEND
13#include <wlr/backend/libinput.h>
14#endif
15
12static void handle_pad_tablet_destroy(struct wl_listener *listener, void *data) { 16static void handle_pad_tablet_destroy(struct wl_listener *listener, void *data) {
13 struct sway_tablet_pad *pad = 17 struct sway_tablet_pad *pad =
14 wl_container_of(listener, pad, tablet_destroy); 18 wl_container_of(listener, pad, tablet_destroy);
@@ -63,6 +67,7 @@ void sway_configure_tablet(struct sway_tablet *tablet) {
63 wlr_tablet_create(server.tablet_v2, seat->wlr_seat, device); 67 wlr_tablet_create(server.tablet_v2, seat->wlr_seat, device);
64 } 68 }
65 69
70#if WLR_HAS_LIBINPUT_BACKEND
66 /* Search for a sibling tablet pad */ 71 /* Search for a sibling tablet pad */
67 if (!wlr_input_device_is_libinput(device)) { 72 if (!wlr_input_device_is_libinput(device)) {
68 /* We can only do this on libinput devices */ 73 /* We can only do this on libinput devices */
@@ -87,6 +92,7 @@ void sway_configure_tablet(struct sway_tablet *tablet) {
87 break; 92 break;
88 } 93 }
89 } 94 }
95#endif
90} 96}
91 97
92void sway_tablet_destroy(struct sway_tablet *tablet) { 98void sway_tablet_destroy(struct sway_tablet *tablet) {
@@ -287,6 +293,7 @@ void sway_configure_tablet_pad(struct sway_tablet_pad *tablet_pad) {
287 tablet_pad->ring.notify = handle_tablet_pad_ring; 293 tablet_pad->ring.notify = handle_tablet_pad_ring;
288 wl_signal_add(&tablet_pad->wlr->events.ring, &tablet_pad->ring); 294 wl_signal_add(&tablet_pad->wlr->events.ring, &tablet_pad->ring);
289 295
296#if WLR_HAS_LIBINPUT_BACKEND
290 /* Search for a sibling tablet */ 297 /* Search for a sibling tablet */
291 if (!wlr_input_device_is_libinput(wlr_device)) { 298 if (!wlr_input_device_is_libinput(wlr_device)) {
292 /* We can only do this on libinput devices */ 299 /* We can only do this on libinput devices */
@@ -311,6 +318,7 @@ void sway_configure_tablet_pad(struct sway_tablet_pad *tablet_pad) {
311 break; 318 break;
312 } 319 }
313 } 320 }
321#endif
314} 322}
315 323
316void sway_tablet_pad_destroy(struct sway_tablet_pad *tablet_pad) { 324void sway_tablet_pad_destroy(struct sway_tablet_pad *tablet_pad) {