From 65302093cfef884bb0a0f86d19e842255186423c Mon Sep 17 00:00:00 2001 From: Adam Kürthy Date: Fri, 24 Apr 2020 03:19:38 +0200 Subject: Take window borders into account when resizing floating windows Otherwise the borders can be resized to smaller than the minimum window size. --- sway/input/seatop_resize_floating.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 3d95295c..4e5db112 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c @@ -73,6 +73,12 @@ static void handle_motion(struct sway_seat *seat, uint32_t time_msec, height = fmax(view_min_height, fmin(height, view_max_height)); } + struct sway_container_state *state = &con->current; + width += state->border_thickness * 2; + height += config->titlebar_border_thickness * 2; + height += container_titlebar_height(); + height += config->titlebar_v_padding; + // Recalculate these, in case we hit a min/max limit grow_width = width - e->ref_width; grow_height = height - e->ref_height; -- cgit v1.2.3