aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/resize.c
diff options
context:
space:
mode:
authorLibravatar Daniel De Graaf <code@danieldg.net>2020-10-21 18:11:29 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2020-10-22 09:10:10 +0200
commit1be66c98f2c06add500bdb9d4b98b6183ab8141f (patch)
tree86a2c15a0f0d27c4da713b3c1473e172034860d8 /sway/commands/resize.c
parenttiling_resize: abandon resize if a sibling con dies (diff)
downloadsway-1be66c98f2c06add500bdb9d4b98b6183ab8141f.tar.gz
sway-1be66c98f2c06add500bdb9d4b98b6183ab8141f.tar.zst
sway-1be66c98f2c06add500bdb9d4b98b6183ab8141f.zip
commands/resize: don't consider 1px resizes to be invalid
A "resize shrink width 1px" will cause grow_x to be 0 while grow_width is -1, incorrectly rejecting the command even though the resize is not a noop. Fix this by checking width/height instead of x/y.
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r--sway/commands/resize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c
index 4038e331..ca36e858 100644
--- a/sway/commands/resize.c
+++ b/sway/commands/resize.c
@@ -224,7 +224,7 @@ static struct cmd_results *resize_adjust_floating(uint32_t axis,
224 } else if (axis == WLR_EDGE_LEFT) { 224 } else if (axis == WLR_EDGE_LEFT) {
225 grow_x = -grow_width; 225 grow_x = -grow_width;
226 } 226 }
227 if (grow_x == 0 && grow_y == 0) { 227 if (grow_width == 0 && grow_height == 0) {
228 return cmd_results_new(CMD_INVALID, "Cannot resize any further"); 228 return cmd_results_new(CMD_INVALID, "Cannot resize any further");
229 } 229 }
230 con->x += grow_x; 230 con->x += grow_x;