From 167409702fbad100cf1f7ddce70d07b3c0281dfc Mon Sep 17 00:00:00 2001 From: Luminarys Date: Sat, 29 Aug 2015 00:33:33 -0500 Subject: Fixed move scratchpad and added in scratchpad show --- sway/layout.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'sway/layout.c') diff --git a/sway/layout.c b/sway/layout.c index c7c5c477..875115e7 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -26,10 +26,20 @@ void init_layout(void) { int index_child(const swayc_t *child) { swayc_t *parent = child->parent; - int i, len = parent->children->length; - for (i = 0; i < len; ++i) { - if (parent->children->items[i] == child) { - break; + int i, len; + if (!child->is_floating) { + len = parent->children->length; + for (i = 0; i < len; ++i) { + if (parent->children->items[i] == child) { + break; + } + } + } else { + len = parent->floating->length; + for (i = 0; i < len; ++i) { + if (parent->floating->items[i] == child) { + break; + } } } if (!sway_assert(i < len, "Stray container")) { -- cgit v1.2.3