diff options
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) { | |||
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | void add_floating(swayc_t *ws, swayc_t *child) { | ||
42 | sway_log(L_DEBUG, "Adding %p (%d, %dx%d) to %p (%d, %dx%d)", child, child->type, | ||
43 | child->width, child->height, ws, ws->type, ws->width, ws->height); | ||
44 | list_add(ws->floating, child); | ||
45 | child->parent = ws; | ||
46 | child->is_floating = true; | ||
47 | if (!ws->focused) { | ||
48 | ws->focused = child; | ||
49 | } | ||
50 | } | ||
51 | |||
41 | swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { | 52 | swayc_t *add_sibling(swayc_t *sibling, swayc_t *child) { |
42 | swayc_t *parent = sibling->parent; | 53 | swayc_t *parent = sibling->parent; |
43 | int i = index_child(parent, sibling); | 54 | int i = index_child(parent, sibling); |
@@ -76,6 +87,7 @@ swayc_t *remove_child(swayc_t *child) { | |||
76 | break; | 87 | break; |
77 | } | 88 | } |
78 | } | 89 | } |
90 | i = 0; | ||
79 | } else { | 91 | } else { |
80 | for (i = 0; i < parent->children->length; ++i) { | 92 | for (i = 0; i < parent->children->length; ++i) { |
81 | if (parent->children->items[i] == child) { | 93 | if (parent->children->items[i] == child) { |