diff options
author | minus <minus@mnus.de> | 2015-08-27 00:44:47 +0200 |
---|---|---|
committer | minus <minus@mnus.de> | 2015-08-27 00:44:47 +0200 |
commit | 6bbfd65735ba17ee55ee90b7021c70d68f27b55a (patch) | |
tree | 49eae9ae84adbe27d639005515111b324a328fad | |
parent | converted IPC to use json-c (diff) | |
download | sway-6bbfd65735ba17ee55ee90b7021c70d68f27b55a.tar.gz sway-6bbfd65735ba17ee55ee90b7021c70d68f27b55a.tar.zst sway-6bbfd65735ba17ee55ee90b7021c70d68f27b55a.zip |
fixed container_map
applies to the passed in container now as well.
fixes workspaces staying always marked visible.
also set workspaces to not visible by default; happens when you move a
container to a new workspace that thus is not visible
-rw-r--r-- | sway/container.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/container.c b/sway/container.c index 5321e3cd..fda90e5b 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -152,7 +152,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { | |||
152 | workspace->width = output->width; | 152 | workspace->width = output->width; |
153 | workspace->height = output->height; | 153 | workspace->height = output->height; |
154 | workspace->name = strdup(name); | 154 | workspace->name = strdup(name); |
155 | workspace->visible = true; | 155 | workspace->visible = false; |
156 | workspace->floating = create_list(); | 156 | workspace->floating = create_list(); |
157 | 157 | ||
158 | add_child(output, workspace); | 158 | add_child(output, workspace); |
@@ -503,18 +503,17 @@ bool swayc_is_active(swayc_t *view) { | |||
503 | 503 | ||
504 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { | 504 | void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { |
505 | if (container) { | 505 | if (container) { |
506 | f(container, data); | ||
506 | int i; | 507 | int i; |
507 | if (container->children) { | 508 | if (container->children) { |
508 | for (i = 0; i < container->children->length; ++i) { | 509 | for (i = 0; i < container->children->length; ++i) { |
509 | swayc_t *child = container->children->items[i]; | 510 | swayc_t *child = container->children->items[i]; |
510 | f(child, data); | ||
511 | container_map(child, f, data); | 511 | container_map(child, f, data); |
512 | } | 512 | } |
513 | } | 513 | } |
514 | if (container->floating) { | 514 | if (container->floating) { |
515 | for (i = 0; i < container->floating->length; ++i) { | 515 | for (i = 0; i < container->floating->length; ++i) { |
516 | swayc_t *child = container->floating->items[i]; | 516 | swayc_t *child = container->floating->items[i]; |
517 | f(child, data); | ||
518 | container_map(child, f, data); | 517 | container_map(child, f, data); |
519 | } | 518 | } |
520 | } | 519 | } |