diff options
author | Luminarys <[email protected]> | 2015-08-29 00:33:33 -0500 |
---|---|---|
committer | Luminarys <[email protected]> | 2015-08-29 00:33:33 -0500 |
commit | 167409702fbad100cf1f7ddce70d07b3c0281dfc (patch) | |
tree | 87b344790b633a0264005d0935ec13964593579b /sway/layout.c | |
parent | 7eefecf4790bd0daf5c5727766c904c8c55dc6ee (diff) |
Fixed move scratchpad and added in scratchpad show
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 18 |
1 files changed, 14 insertions, 4 deletions
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")) { |