aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/resize.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-23 00:02:08 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-23 00:02:08 +1000
commit662466e8db773926bf61b21280194a3540ae26ec (patch)
tree6d86a12b8abf8b290b845576e94021d611390898 /sway/commands/resize.c
parentMerge pull request #2924 from RyanDwyer/fix-qt-menu-crash (diff)
downloadsway-662466e8db773926bf61b21280194a3540ae26ec.tar.gz
sway-662466e8db773926bf61b21280194a3540ae26ec.tar.zst
sway-662466e8db773926bf61b21280194a3540ae26ec.zip
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.
Diffstat (limited to 'sway/commands/resize.c')
-rw-r--r--sway/commands/resize.c4
1 files changed, 2 insertions, 2 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;