aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar D.B <thejan.2009@gmail.com>2016-10-10 21:26:08 +0200
committerLibravatar D.B <thejan.2009@gmail.com>2016-10-11 06:22:54 +0200
commit24c3b8606555671cf31fe17db5d783846868a447 (patch)
tree2c25f0bb2b0c37b28e4bcc32fb65ece10a7d9c06 /sway/container.c
parentMerge pull request #947 from alkino/fix_move_empty_workspace (diff)
downloadsway-24c3b8606555671cf31fe17db5d783846868a447.tar.gz
sway-24c3b8606555671cf31fe17db5d783846868a447.tar.zst
sway-24c3b8606555671cf31fe17db5d783846868a447.zip
also check floating cons in container_find
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sway/container.c b/sway/container.c
index 9d5e2690..4f22eb0d 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -727,14 +727,29 @@ swayc_t *container_find(swayc_t *container, bool (*f)(swayc_t *, const void *),
727 return NULL; 727 return NULL;
728 } 728 }
729 729
730 swayc_t *con;
731 if (container->type == C_WORKSPACE) {
732 for (int i = 0; i < container->floating->length; ++i) {
733 con = container->floating->items[i];
734 if (f(con, data)) {
735 return con;
736 }
737 con = container_find(con, f, data);
738 if (con != NULL) {
739 return con;
740 }
741 }
742 }
743
730 for (int i = 0; i < container->children->length; ++i) { 744 for (int i = 0; i < container->children->length; ++i) {
731 if (f(container->children->items[i], data)) { 745 con = container->children->items[i];
732 return container->children->items[i]; 746 if (f(con, data)) {
747 return con;
733 } 748 }
734 749
735 swayc_t *find = container_find(container->children->items[i], f, data); 750 con = container_find(con, f, data);
736 if (find != NULL) { 751 if (con != NULL) {
737 return find; 752 return con;
738 } 753 }
739 } 754 }
740 755