aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/commands/resize.c4
-rw-r--r--sway/tree/container.c10
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,
94 *min_height = config->floating_minimum_height; 94 *min_height = config->floating_minimum_height;
95 } 95 }
96 96
97 if (config->floating_maximum_width == -1) { // no maximum 97 if (config->floating_maximum_width == -1 || !con->workspace) { // no max
98 *max_width = INT_MAX; 98 *max_width = INT_MAX;
99 } else if (config->floating_maximum_width == 0) { // automatic 99 } else if (config->floating_maximum_width == 0) { // automatic
100 *max_width = con->workspace->width; 100 *max_width = con->workspace->width;
@@ -102,7 +102,7 @@ static void calculate_constraints(int *min_width, int *max_width,
102 *max_width = config->floating_maximum_width; 102 *max_width = config->floating_maximum_width;
103 } 103 }
104 104
105 if (config->floating_maximum_height == -1) { // no maximum 105 if (config->floating_maximum_height == -1 || !con->workspace) { // no max
106 *max_height = INT_MAX; 106 *max_height = INT_MAX;
107 } else if (config->floating_maximum_height == 0) { // automatic 107 } else if (config->floating_maximum_height == 0) { // automatic
108 *max_height = con->workspace->height; 108 *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) {
727} 727}
728 728
729bool container_is_floating(struct sway_container *container) { 729bool container_is_floating(struct sway_container *container) {
730 return !container->parent && container->workspace && 730 if (!container->parent && container->workspace &&
731 list_find(container->workspace->floating, container) != -1; 731 list_find(container->workspace->floating, container) != -1) {
732 return true;
733 }
734 if (container->scratchpad) {
735 return true;
736 }
737 return false;
732} 738}
733 739
734void container_get_box(struct sway_container *container, struct wlr_box *box) { 740void container_get_box(struct sway_container *container, struct wlr_box *box) {