summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-02-10 15:23:50 -0500
committerFurkan Sahin <furkan-dev@proton.me>2019-02-10 15:23:50 -0500
commit4c9d69d94a953fcb778cf5d7c02a0a140846f543 (patch)
tree13008011fb4b16dd6cbfce1e307a544ea99aa0db
parent200c98273ac7b5d193a0d1ac20cfeece3a9014a4 (diff)
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.
-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) {
struct sway_seat *seat;
wl_list_for_each(seat, &server.input->seats, link) {
seat->cursor->image_surface = NULL;
+ if (seat->cursor->active_constraint) {
+ struct wlr_surface *constrain_surface =
+ seat->cursor->active_constraint->surface;
+ if (view_from_wlr_surface(constrain_surface) == view) {
+ sway_cursor_constrain(seat->cursor, NULL);
+ }
+ }
seat_consider_warp_to_focus(seat);
}