aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.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/tree/container.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/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) {
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) {