diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-22 23:45:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-22 23:45:22 +0200 |
commit | 40c98768e1f63a853a729b681953c1f148d9734c (patch) | |
tree | 8e1637e3cd45a12c1e4c1df98ceced408136fc37 | |
parent | d9ed9445de73c138ddda21483c2ee49a73926dd8 (diff) | |
parent | bb06a57a71074c1ecd570209fa6f1b12523fed8a (diff) | |
download | sway-40c98768e1f63a853a729b681953c1f148d9734c.tar.xz |
Merge pull request #2929 from RyanDwyer/fix-scratchpad-resize
Fix crash when resizing container hidden in the scratchpad
-rw-r--r-- | sway/commands/resize.c | 4 | ||||
-rw-r--r-- | sway/tree/container.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sway/commands/resize.c b/sway/commands/resize.c index 6de14ca3..8666f40b 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -94,7 +94,7 @@ static void calculate_constraints(int *min_width, int *max_width, *min_height = config->floating_minimum_height; } - if (config->floating_maximum_width == -1) { // no maximum + if (config->floating_maximum_width == -1 || !con->workspace) { // no max *max_width = INT_MAX; } else if (config->floating_maximum_width == 0) { // automatic *max_width = con->workspace->width; @@ -102,7 +102,7 @@ static void calculate_constraints(int *min_width, int *max_width, *max_width = config->floating_maximum_width; } - if (config->floating_maximum_height == -1) { // no maximum + if (config->floating_maximum_height == -1 || !con->workspace) { // no max *max_height = INT_MAX; } else if (config->floating_maximum_height == 0) { // automatic *max_height = con->workspace->height; diff --git a/sway/tree/container.c b/sway/tree/container.c index b41e8dd4..58d3df34 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -727,8 +727,14 @@ void container_set_geometry_from_floating_view(struct sway_container *con) { } bool container_is_floating(struct sway_container *container) { - return !container->parent && container->workspace && - list_find(container->workspace->floating, container) != -1; + if (!container->parent && container->workspace && + list_find(container->workspace->floating, container) != -1) { + return true; + } + if (container->scratchpad) { + return true; + } + return false; } void container_get_box(struct sway_container *container, struct wlr_box *box) { |