diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-11-16 17:20:55 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-11-16 17:20:55 -0500 |
commit | 4434be835d6aaf6314f2596181295fabd883eac9 (patch) | |
tree | a598c24dd3e31067a44d03b2f8a9ceaa3c94e912 | |
parent | ae7d8870e776deca116d2a5099eaba5c3fc9c33a (diff) |
wlr-seat: clear touch focus on touch point destroy
-rw-r--r-- | types/wlr_seat.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/types/wlr_seat.c b/types/wlr_seat.c index c37611b3..6566d397 100644 --- a/types/wlr_seat.c +++ b/types/wlr_seat.c @@ -910,8 +910,18 @@ void wlr_seat_touch_end_grab(struct wlr_seat *wlr_seat) { } } +static void touch_point_clear_focus(struct wlr_touch_point *point) { + if (point->focus_surface) { + wl_list_remove(&point->focus_surface_destroy.link); + point->focus_client = NULL; + point->focus_surface = NULL; + } +} + static void touch_point_destroy(struct wlr_touch_point *point) { wl_signal_emit(&point->events.destroy, point); + + touch_point_clear_focus(point); wl_list_remove(&point->surface_destroy.link); wl_list_remove(&point->resource_destroy.link); wl_list_remove(&point->link); @@ -1030,14 +1040,6 @@ void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time, grab->interface->motion(grab, time, point); } -static void touch_point_clear_focus(struct wlr_touch_point *point) { - if (point->focus_surface) { - wl_list_remove(&point->focus_surface_destroy.link); - point->focus_client = NULL; - point->focus_surface = NULL; - } -} - static void handle_point_focus_destroy(struct wl_listener *listener, void *data) { struct wlr_touch_point *point = @@ -1095,7 +1097,7 @@ void wlr_seat_touch_point_clear_focus(struct wlr_seat *seat, uint32_t time, return; } - touch_point_set_focus(point, NULL, 0, 0); + touch_point_clear_focus(point); } void wlr_seat_touch_send_down(struct wlr_seat *seat, |