aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-02-10 15:23:50 -0500
committerLibravatar emersion <contact@emersion.fr>2019-02-10 21:29:45 +0100
commit418c19fe528190918d41aefed46abe02c8b6834f (patch)
tree13008011fb4b16dd6cbfce1e307a544ea99aa0db /sway/tree/view.c
parentinput/keyboard: respect solo repeat_{rate,delay} (diff)
downloadsway-418c19fe528190918d41aefed46abe02c8b6834f.tar.gz
sway-418c19fe528190918d41aefed46abe02c8b6834f.tar.zst
sway-418c19fe528190918d41aefed46abe02c8b6834f.zip
view: remove pointer constraints on unmap
If the view has any pointer constraints, ensure they are removed before the view is unmapped and the surface is no longer tied to the view.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 612cf96a..943734dc 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -664,6 +664,13 @@ void view_unmap(struct sway_view *view) {
664 struct sway_seat *seat; 664 struct sway_seat *seat;
665 wl_list_for_each(seat, &server.input->seats, link) { 665 wl_list_for_each(seat, &server.input->seats, link) {
666 seat->cursor->image_surface = NULL; 666 seat->cursor->image_surface = NULL;
667 if (seat->cursor->active_constraint) {
668 struct wlr_surface *constrain_surface =
669 seat->cursor->active_constraint->surface;
670 if (view_from_wlr_surface(constrain_surface) == view) {
671 sway_cursor_constrain(seat->cursor, NULL);
672 }
673 }
667 seat_consider_warp_to_focus(seat); 674 seat_consider_warp_to_focus(seat);
668 } 675 }
669 676