From 1ad4632ab0ac6dbb81a03402a3062226f8daa817 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Wed, 13 Jan 2021 10:52:17 -0700 Subject: [PATCH] seat: set the handler_context in seatops Ensures that the container operations which result from cursor actions reference the right seat --- sway/input/seatop_move_tiling.c | 1 + sway/input/seatop_resize_floating.c | 2 ++ sway/input/seatop_resize_tiling.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/sway/input/seatop_move_tiling.c b/sway/input/seatop_move_tiling.c index 704e7270..caf92621 100644 --- a/sway/input/seatop_move_tiling.c +++ b/sway/input/seatop_move_tiling.c @@ -230,6 +230,7 @@ static void finalize_move(struct sway_seat *seat) { seatop_begin_default(seat); return; } + config->handler_context.seat = seat; struct sway_container *con = e->con; struct sway_container *old_parent = con->parent; diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 5da22e47..d484968b 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c @@ -49,6 +49,8 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { mouse_move_y = 0; } + config->handler_context.seat = seat; + double grow_width = edge & WLR_EDGE_LEFT ? -mouse_move_x : mouse_move_x; double grow_height = edge & WLR_EDGE_TOP ? -mouse_move_y : mouse_move_y; diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index 2cca805d..c474b1f5 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c @@ -93,6 +93,8 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { } } + config->handler_context.seat = seat; + if (amount_x != 0) { container_resize_tiled(e->h_con, e->edge_x, amount_x); }