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.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sway/input/tablet.c b/sway/input/tablet.c
index db2f93ec..92ede3fa 100644
--- a/sway/input/tablet.c
+++ b/sway/input/tablet.c
@@ -246,6 +246,7 @@ struct sway_tablet_pad *sway_tablet_pad_create(struct sway_seat *seat,
246 return NULL; 246 return NULL;
247 } 247 }
248 248
249 tablet_pad->wlr = wlr_tablet_pad_from_input_device(device->input_device->wlr_device);
249 tablet_pad->seat_device = device; 250 tablet_pad->seat_device = device;
250 wl_list_init(&tablet_pad->attach.link); 251 wl_list_init(&tablet_pad->attach.link);
251 wl_list_init(&tablet_pad->button.link); 252 wl_list_init(&tablet_pad->button.link);
@@ -260,40 +261,40 @@ struct sway_tablet_pad *sway_tablet_pad_create(struct sway_seat *seat,
260} 261}
261 262
262void sway_configure_tablet_pad(struct sway_tablet_pad *tablet_pad) { 263void sway_configure_tablet_pad(struct sway_tablet_pad *tablet_pad) {
263 struct wlr_input_device *device = 264 struct wlr_input_device *wlr_device =
264 tablet_pad->seat_device->input_device->wlr_device; 265 tablet_pad->seat_device->input_device->wlr_device;
265 struct sway_seat *seat = tablet_pad->seat_device->sway_seat; 266 struct sway_seat *seat = tablet_pad->seat_device->sway_seat;
266 267
267 if (!tablet_pad->tablet_v2_pad) { 268 if (!tablet_pad->tablet_v2_pad) {
268 tablet_pad->tablet_v2_pad = 269 tablet_pad->tablet_v2_pad =
269 wlr_tablet_pad_create(server.tablet_v2, seat->wlr_seat, device); 270 wlr_tablet_pad_create(server.tablet_v2, seat->wlr_seat, wlr_device);
270 } 271 }
271 272
272 wl_list_remove(&tablet_pad->attach.link); 273 wl_list_remove(&tablet_pad->attach.link);
273 tablet_pad->attach.notify = handle_tablet_pad_attach; 274 tablet_pad->attach.notify = handle_tablet_pad_attach;
274 wl_signal_add(&device->tablet_pad->events.attach_tablet, 275 wl_signal_add(&tablet_pad->wlr->events.attach_tablet,
275 &tablet_pad->attach); 276 &tablet_pad->attach);
276 277
277 wl_list_remove(&tablet_pad->button.link); 278 wl_list_remove(&tablet_pad->button.link);
278 tablet_pad->button.notify = handle_tablet_pad_button; 279 tablet_pad->button.notify = handle_tablet_pad_button;
279 wl_signal_add(&device->tablet_pad->events.button, &tablet_pad->button); 280 wl_signal_add(&tablet_pad->wlr->events.button, &tablet_pad->button);
280 281
281 wl_list_remove(&tablet_pad->strip.link); 282 wl_list_remove(&tablet_pad->strip.link);
282 tablet_pad->strip.notify = handle_tablet_pad_strip; 283 tablet_pad->strip.notify = handle_tablet_pad_strip;
283 wl_signal_add(&device->tablet_pad->events.strip, &tablet_pad->strip); 284 wl_signal_add(&tablet_pad->wlr->events.strip, &tablet_pad->strip);
284 285
285 wl_list_remove(&tablet_pad->ring.link); 286 wl_list_remove(&tablet_pad->ring.link);
286 tablet_pad->ring.notify = handle_tablet_pad_ring; 287 tablet_pad->ring.notify = handle_tablet_pad_ring;
287 wl_signal_add(&device->tablet_pad->events.ring, &tablet_pad->ring); 288 wl_signal_add(&tablet_pad->wlr->events.ring, &tablet_pad->ring);
288 289
289 /* Search for a sibling tablet */ 290 /* Search for a sibling tablet */
290 if (!wlr_input_device_is_libinput(device)) { 291 if (!wlr_input_device_is_libinput(wlr_device)) {
291 /* We can only do this on libinput devices */ 292 /* We can only do this on libinput devices */
292 return; 293 return;
293 } 294 }
294 295
295 struct libinput_device_group *group = 296 struct libinput_device_group *group =
296 libinput_device_get_device_group(wlr_libinput_get_device_handle(device)); 297 libinput_device_get_device_group(wlr_libinput_get_device_handle(wlr_device));
297 struct sway_tablet *tool; 298 struct sway_tablet *tool;
298 wl_list_for_each(tool, &seat->cursor->tablets, link) { 299 wl_list_for_each(tool, &seat->cursor->tablets, link) {
299 struct wlr_input_device *tablet = 300 struct wlr_input_device *tablet =