aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 271c95f9..bb846e38 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -511,8 +511,7 @@ static void apply_mapping_from_region(struct wlr_input_device *device,
511} 511}
512 512
513static void handle_tablet_tool_position(struct sway_cursor *cursor, 513static void handle_tablet_tool_position(struct sway_cursor *cursor,
514 struct sway_tablet *tablet, 514 struct sway_tablet_tool *tool,
515 struct wlr_tablet_tool *tool,
516 bool change_x, bool change_y, 515 bool change_x, bool change_y,
517 double x, double y, double dx, double dy, 516 double x, double y, double dx, double dy,
518 int32_t time_msec) { 517 int32_t time_msec) {
@@ -522,6 +521,7 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
522 return; 521 return;
523 } 522 }
524 523
524 struct sway_tablet *tablet = tool->tablet;
525 struct sway_input_device *input_device = tablet->seat_device->input_device; 525 struct sway_input_device *input_device = tablet->seat_device->input_device;
526 struct input_config *ic = input_device_get_config(input_device); 526 struct input_config *ic = input_device_get_config(input_device);
527 if (ic != NULL && ic->mapped_from_region != NULL) { 527 if (ic != NULL && ic->mapped_from_region != NULL) {
@@ -529,7 +529,7 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
529 ic->mapped_from_region, &x, &y); 529 ic->mapped_from_region, &x, &y);
530 } 530 }
531 531
532 switch (tool->type) { 532 switch (tool->tablet_v2_tool->wlr_tool->type) {
533 case WLR_TABLET_TOOL_TYPE_MOUSE: 533 case WLR_TABLET_TOOL_TYPE_MOUSE:
534 wlr_cursor_move(cursor->cursor, input_device->wlr_device, dx, dy); 534 wlr_cursor_move(cursor->cursor, input_device->wlr_device, dx, dy);
535 break; 535 break;
@@ -542,12 +542,11 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
542 struct wlr_surface *surface = NULL; 542 struct wlr_surface *surface = NULL;
543 struct sway_seat *seat = cursor->seat; 543 struct sway_seat *seat = cursor->seat;
544 node_at_coords(seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); 544 node_at_coords(seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
545 struct sway_tablet_tool *sway_tool = tool->data;
546 545
547 if (surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) { 546 if (surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) {
548 seatop_tablet_tool_motion(seat, tablet, sway_tool, time_msec, dx, dy); 547 seatop_tablet_tool_motion(seat, tool, time_msec, dx, dy);
549 } else { 548 } else {
550 wlr_tablet_v2_tablet_tool_notify_proximity_out(sway_tool->tablet_v2_tool); 549 wlr_tablet_v2_tablet_tool_notify_proximity_out(tool->tablet_v2_tool);
551 pointer_motion(cursor, time_msec, input_device->wlr_device, dx, dy, dx, dy); 550 pointer_motion(cursor, time_msec, input_device->wlr_device, dx, dy, dx, dy);
552 } 551 }
553 552
@@ -565,7 +564,7 @@ static void handle_tool_axis(struct wl_listener *listener, void *data) {
565 return; 564 return;
566 } 565 }
567 566
568 handle_tablet_tool_position(cursor, sway_tool->tablet, event->tool, 567 handle_tablet_tool_position(cursor, sway_tool,
569 event->updated_axes & WLR_TABLET_TOOL_AXIS_X, 568 event->updated_axes & WLR_TABLET_TOOL_AXIS_X,
570 event->updated_axes & WLR_TABLET_TOOL_AXIS_Y, 569 event->updated_axes & WLR_TABLET_TOOL_AXIS_Y,
571 event->x, event->y, event->dx, event->dy, event->time_msec); 570 event->x, event->y, event->dx, event->dy, event->time_msec);
@@ -691,8 +690,8 @@ static void handle_tool_proximity(struct wl_listener *listener, void *data) {
691 return; 690 return;
692 } 691 }
693 692
694 handle_tablet_tool_position(cursor, sway_tool->tablet, event->tool, 693 handle_tablet_tool_position(cursor, sway_tool, true, true, event->x, event->y,
695 true, true, event->x, event->y, 0, 0, event->time_msec); 694 0, 0, event->time_msec);
696} 695}
697 696
698static void handle_tool_button(struct wl_listener *listener, void *data) { 697static void handle_tool_button(struct wl_listener *listener, void *data) {