aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kürthy <adikurthy@gmail.com>2020-04-24 03:19:38 +0200
committerSimon Ser <contact@emersion.fr>2020-04-24 18:41:33 +0200
commit65302093cfef884bb0a0f86d19e842255186423c (patch)
tree35ecd247d70966e01b7d96f8599ce6c13c0fbca5
parent44b2d3ad81cd11aa7f21a3954ce70a0c21adfa23 (diff)
Take window borders into account when resizing floating windows
Otherwise the borders can be resized to smaller than the minimum window size.
-rw-r--r--sway/input/seatop_resize_floating.c6
1 files changed, 6 insertions, 0 deletions
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;