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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 8121cc84..8de7d950 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -572,7 +572,19 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
572 struct sway_seat *seat = cursor->seat; 572 struct sway_seat *seat = cursor->seat;
573 node_at_coords(seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); 573 node_at_coords(seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);
574 574
575 if (surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) { 575 // The logic for whether we should send a tablet event or an emulated pointer
576 // event is tricky. It comes down to:
577 // * If we began a drag on a non-tablet surface (simulated_tool_tip_down),
578 // then we should continue sending emulated pointer events regardless of
579 // whether the surface currently under us accepts tablet or not.
580 // * Otherwise, if we are over a surface that accepts tablet, then we should
581 // send tablet events.
582 // * If we began a drag over a tablet surface, we should continue sending
583 // tablet events until the drag is released, even if we are now over a
584 // non-tablet surface.
585 if (!cursor->simulated_tool_tip_down &&
586 ((surface && wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) ||
587 wlr_tablet_tool_v2_has_implicit_grab(tool->tablet_v2_tool))) {
576 seatop_tablet_tool_motion(seat, tool, time_msec, dx, dy); 588 seatop_tablet_tool_motion(seat, tool, time_msec, dx, dy);
577 } else { 589 } else {
578 wlr_tablet_v2_tablet_tool_notify_proximity_out(tool->tablet_v2_tool); 590 wlr_tablet_v2_tablet_tool_notify_proximity_out(tool->tablet_v2_tool);
@@ -680,6 +692,8 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) {
680 692
681 wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool); 693 wlr_tablet_v2_tablet_tool_notify_up(sway_tool->tablet_v2_tool);
682 } 694 }
695
696 seatop_tablet_tool_tip(seat, sway_tool, event->time_msec, event->state);
683} 697}
684 698
685static struct sway_tablet *get_tablet_for_device(struct sway_cursor *cursor, 699static struct sway_tablet *get_tablet_for_device(struct sway_cursor *cursor,