diff options
author | Drew DeVault <[email protected]> | 2015-08-19 07:14:03 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-08-19 07:14:03 -0400 |
commit | 8fb2e7e34e279a005a4d42e224f71f9b35ddf918 (patch) | |
tree | a04cc657974f755360c5102a88c908a5160f61cd /sway/layout.c | |
parent | ae367c5af496828cf326f55597db26fcbfefe6d0 (diff) | |
parent | c5a69828934bf07db9062bd5f24bb2ff94b45b4a (diff) |
Merge pull request #79 from taiyu-len/master
fixed floating_modifier related things
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index e2e12901..7125ffc3 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -38,6 +38,17 @@ void add_child(swayc_t *parent, swayc_t *child) { } } +void add_floating(swayc_t *ws, swayc_t *child) { + sway_log(L_DEBUG, "Adding %p (%d, %dx%d) to %p (%d, %dx%d)", child, child->type, + child->width, child->height, ws, ws->type, ws->width, ws->height); + list_add(ws->floating, child); + child->parent = ws; + child->is_floating = true; + if (!ws->focused) { + ws->focused = child; + } +} + swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { swayc_t *parent = sibling->parent; int i = index_child(parent, sibling); @@ -76,6 +87,7 @@ swayc_t *remove_child(swayc_t *child) { break; } } + i = 0; } else { for (i = 0; i < parent->children->length; ++i) { if (parent->children->items[i] == child) { |