From 662466e8db773926bf61b21280194a3540ae26ec Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 23 Oct 2018 00:02:08 +1000 Subject: Fix crash when resizing container hidden in the scratchpad Firstly, the container was wrongly identifying as a tiling container because it had no workspace. Secondly, when calculating the maximum possible size we can't use the workspace if it's not there, so we'll allow unlimited size in this case. --- sway/commands/resize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/commands') 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; -- cgit v1.2.3