aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Adam Kürthy <adikurthy@gmail.com>2020-04-24 03:19:38 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2020-04-24 18:41:33 +0200
commit65302093cfef884bb0a0f86d19e842255186423c (patch)
tree35ecd247d70966e01b7d96f8599ce6c13c0fbca5
parentinput/cursor: fix hide cursor timeouts on tablets and touchscreens (diff)
downloadsway-65302093cfef884bb0a0f86d19e842255186423c.tar.gz
sway-65302093cfef884bb0a0f86d19e842255186423c.tar.zst
sway-65302093cfef884bb0a0f86d19e842255186423c.zip
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,
73 height = fmax(view_min_height, fmin(height, view_max_height)); 73 height = fmax(view_min_height, fmin(height, view_max_height));
74 } 74 }
75 75
76 struct sway_container_state *state = &con->current;
77 width += state->border_thickness * 2;
78 height += config->titlebar_border_thickness * 2;
79 height += container_titlebar_height();
80 height += config->titlebar_v_padding;
81
76 // Recalculate these, in case we hit a min/max limit 82 // Recalculate these, in case we hit a min/max limit
77 grow_width = width - e->ref_width; 83 grow_width = width - e->ref_width;
78 grow_height = height - e->ref_height; 84 grow_height = height - e->ref_height;