diff options
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r-- | sway/commands/resize.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index 204de539..c9261535 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c | |||
@@ -86,7 +86,8 @@ static void calculate_constraints(int *min_width, int *max_width, | |||
86 | *min_height = config->floating_minimum_height; | 86 | *min_height = config->floating_minimum_height; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (config->floating_maximum_width == -1 || !con->workspace) { // no max | 89 | if (config->floating_maximum_width == -1 || |
90 | container_is_scratchpad_hidden(con)) { // no max | ||
90 | *max_width = INT_MAX; | 91 | *max_width = INT_MAX; |
91 | } else if (config->floating_maximum_width == 0) { // automatic | 92 | } else if (config->floating_maximum_width == 0) { // automatic |
92 | *max_width = con->workspace->width; | 93 | *max_width = con->workspace->width; |
@@ -94,7 +95,8 @@ static void calculate_constraints(int *min_width, int *max_width, | |||
94 | *max_width = config->floating_maximum_width; | 95 | *max_width = config->floating_maximum_width; |
95 | } | 96 | } |
96 | 97 | ||
97 | if (config->floating_maximum_height == -1 || !con->workspace) { // no max | 98 | if (config->floating_maximum_height == -1 || |
99 | container_is_scratchpad_hidden(con)) { // no max | ||
98 | *max_height = INT_MAX; | 100 | *max_height = INT_MAX; |
99 | } else if (config->floating_maximum_height == 0) { // automatic | 101 | } else if (config->floating_maximum_height == 0) { // automatic |
100 | *max_height = con->workspace->height; | 102 | *max_height = con->workspace->height; |
@@ -386,7 +388,7 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, | |||
386 | if (width->amount) { | 388 | if (width->amount) { |
387 | switch (width->unit) { | 389 | switch (width->unit) { |
388 | case RESIZE_UNIT_PPT: | 390 | case RESIZE_UNIT_PPT: |
389 | if (con->scratchpad && !con->workspace) { | 391 | if (container_is_scratchpad_hidden(con)) { |
390 | return cmd_results_new(CMD_FAILURE, | 392 | return cmd_results_new(CMD_FAILURE, |
391 | "Cannot resize a hidden scratchpad container by ppt"); | 393 | "Cannot resize a hidden scratchpad container by ppt"); |
392 | } | 394 | } |
@@ -410,7 +412,7 @@ static struct cmd_results *resize_set_floating(struct sway_container *con, | |||
410 | if (height->amount) { | 412 | if (height->amount) { |
411 | switch (height->unit) { | 413 | switch (height->unit) { |
412 | case RESIZE_UNIT_PPT: | 414 | case RESIZE_UNIT_PPT: |
413 | if (con->scratchpad && !con->workspace) { | 415 | if (container_is_scratchpad_hidden(con)) { |
414 | return cmd_results_new(CMD_FAILURE, | 416 | return cmd_results_new(CMD_FAILURE, |
415 | "Cannot resize a hidden scratchpad container by ppt"); | 417 | "Cannot resize a hidden scratchpad container by ppt"); |
416 | } | 418 | } |