diff options
author | Drew DeVault <[email protected]> | 2015-08-29 06:51:16 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-08-29 06:51:16 -0400 |
commit | 6b962ebd22767a6c3fa9317ef1fdc814d195854a (patch) | |
tree | 9712d5f68fee99ead21b6f0769d325d427a2dc30 /sway/layout.c | |
parent | 836f24b04713217fea569c240b1cd6cb922d5091 (diff) | |
parent | 167409702fbad100cf1f7ddce70d07b3c0281dfc (diff) |
Merge pull request #150 from Luminarys/master
Added in Scratchpad
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sway/layout.c b/sway/layout.c index b558e704..875115e7 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -10,6 +10,7 @@ #include "focus.h" swayc_t root_container; +list_t *scratchpad; int min_sane_h = 60; int min_sane_w = 100; @@ -20,14 +21,25 @@ void init_layout(void) { root_container.children = create_list(); root_container.handle = -1; root_container.visible = true; + scratchpad = create_list(); } 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")) { |