aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-10-23 00:02:08 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-10-23 00:02:08 +1000
commit662466e8db773926bf61b21280194a3540ae26ec (patch)
tree6d86a12b8abf8b290b845576e94021d611390898 /sway/tree/container.c
parentcdbfc3338bcaef113ef013a8234ad668eea22a3c (diff)
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/tree/container.c')
-rw-r--r--sway/tree/container.c10
1 files changed, 8 insertions, 2 deletions
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) {