diff options
Diffstat (limited to 'sway/input/seatop_resize_tiling.c')
-rw-r--r-- | sway/input/seatop_resize_tiling.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sway/input/seatop_resize_tiling.c b/sway/input/seatop_resize_tiling.c index db32065c..6b705823 100644 --- a/sway/input/seatop_resize_tiling.c +++ b/sway/input/seatop_resize_tiling.c @@ -19,7 +19,16 @@ struct seatop_resize_tiling_event { double v_con_orig_height; // height of the vertical ancestor at start }; -static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { +static void handle_button(struct sway_seat *seat, uint32_t time_msec, + struct wlr_input_device *device, uint32_t button, + enum wlr_button_state state) { + if (seat->cursor->pressed_button_count == 0) { + seatop_begin_default(seat); + } +} + +static void handle_motion(struct sway_seat *seat, uint32_t time_msec, + double dx, double dy) { struct seatop_resize_tiling_event *e = seat->seatop_data; int amount_x = 0; int amount_y = 0; @@ -49,31 +58,22 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec) { } } -static void handle_finish(struct sway_seat *seat, uint32_t time_msec) { - cursor_set_image(seat->cursor, "left_ptr", NULL); -} - -static void handle_abort(struct sway_seat *seat) { - cursor_set_image(seat->cursor, "left_ptr", NULL); -} - static void handle_unref(struct sway_seat *seat, struct sway_container *con) { struct seatop_resize_tiling_event *e = seat->seatop_data; if (e->con == con) { - seatop_abort(seat); + seatop_begin_default(seat); } } static const struct sway_seatop_impl seatop_impl = { + .button = handle_button, .motion = handle_motion, - .finish = handle_finish, - .abort = handle_abort, .unref = handle_unref, }; void seatop_begin_resize_tiling(struct sway_seat *seat, - struct sway_container *con, uint32_t button, enum wlr_edges edge) { - seatop_abort(seat); + struct sway_container *con, enum wlr_edges edge) { + seatop_end(seat); struct seatop_resize_tiling_event *e = calloc(1, sizeof(struct seatop_resize_tiling_event)); @@ -105,5 +105,4 @@ void seatop_begin_resize_tiling(struct sway_seat *seat, seat->seatop_impl = &seatop_impl; seat->seatop_data = e; - seat->seatop_button = button; } |