diff options
Diffstat (limited to 'sway/input/seatop_down.c')
-rw-r--r-- | sway/input/seatop_down.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/input/seatop_down.c b/sway/input/seatop_down.c index 6447134e..c5901f6a 100644 --- a/sway/input/seatop_down.c +++ b/sway/input/seatop_down.c @@ -104,6 +104,24 @@ static void handle_touch_down(struct sway_seat *seat, } } +static void handle_touch_cancel(struct sway_seat *seat, + struct wlr_touch_cancel_event *event) { + struct seatop_down_event *e = seat->seatop_data; + struct seatop_touch_point_event *point_event, *tmp; + + wl_list_for_each_safe(point_event, tmp, &e->point_events, link) { + if (point_event->touch_id == event->touch_id) { + wl_list_remove(&point_event->link); + free(point_event); + break; + } + } + + if (e->surface) { + wlr_seat_touch_notify_cancel(seat->wlr_seat, e->surface); + } +} + static void handle_pointer_axis(struct sway_seat *seat, struct wlr_pointer_axis_event *event) { struct sway_input_device *input_device = @@ -189,6 +207,7 @@ static const struct sway_seatop_impl seatop_impl = { .touch_motion = handle_touch_motion, .touch_up = handle_touch_up, .touch_down = handle_touch_down, + .touch_cancel = handle_touch_cancel, .unref = handle_unref, .end = handle_end, .allow_set_cursor = true, |