diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index d241f69a..b7b9bc68 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -157,7 +157,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) { | |||
157 | if (!sway_assert(sibling, "new_view called with NULL sibling/parent")) { | 157 | if (!sway_assert(sibling, "new_view called with NULL sibling/parent")) { |
158 | return NULL; | 158 | return NULL; |
159 | } | 159 | } |
160 | const char *title = sway_view->iface.get_prop(sway_view, VIEW_PROP_TITLE); | 160 | const char *title = view_get_title(sway_view); |
161 | swayc_t *swayc = new_swayc(C_VIEW); | 161 | swayc_t *swayc = new_swayc(C_VIEW); |
162 | wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d", | 162 | wlr_log(L_DEBUG, "Adding new view %p:%s to container %p %d", |
163 | swayc, title, sibling, sibling ? sibling->type : 0); | 163 | swayc, title, sibling, sibling ? sibling->type : 0); |
@@ -321,3 +321,25 @@ swayc_t *swayc_at(swayc_t *parent, double lx, double ly, | |||
321 | 321 | ||
322 | return NULL; | 322 | return NULL; |
323 | } | 323 | } |
324 | |||
325 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { | ||
326 | if (container) { | ||
327 | int i; | ||
328 | if (container->children) { | ||
329 | for (i = 0; i < container->children->length; ++i) { | ||
330 | swayc_t *child = container->children->items[i]; | ||
331 | container_map(child, f, data); | ||
332 | } | ||
333 | } | ||
334 | // TODO | ||
335 | /* | ||
336 | if (container->floating) { | ||
337 | for (i = 0; i < container->floating->length; ++i) { | ||
338 | swayc_t *child = container->floating->items[i]; | ||
339 | container_map(child, f, data); | ||
340 | } | ||
341 | } | ||
342 | */ | ||
343 | f(container, data); | ||
344 | } | ||
345 | } | ||