diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-10-11 08:22:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-11 08:22:13 -0400 |
commit | 9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3 (patch) | |
tree | 2c25f0bb2b0c37b28e4bcc32fb65ece10a7d9c06 | |
parent | Merge pull request #947 from alkino/fix_move_empty_workspace (diff) | |
parent | also check floating cons in container_find (diff) | |
download | sway-9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3.tar.gz sway-9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3.tar.zst sway-9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3.zip |
Merge pull request #948 from thejan2009/floating-titlebar-click
also check floating cons in container_find
-rw-r--r-- | sway/container.c | 25 |
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 | ||