aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar Nicolas Cornu <ncornu@aldebaran.com>2016-10-06 20:23:46 +0200
committerLibravatar Nicolas Cornu <ncornu@aldebaran.com>2016-10-06 20:23:46 +0200
commit37065cd0c4faa6757f1f53bfd5c2bf8b521edc7c (patch)
tree3f70c9beb4f0ed4e588652969e9e9bcbdaa53adc /sway/container.c
parentMerge pull request #928 from wasamasa/bugfix-swaylock-font (diff)
downloadsway-37065cd0c4faa6757f1f53bfd5c2bf8b521edc7c.tar.gz
sway-37065cd0c4faa6757f1f53bfd5c2bf8b521edc7c.tar.zst
sway-37065cd0c4faa6757f1f53bfd5c2bf8b521edc7c.zip
add click on title_bar to focus a container
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c
index 73b627ec..9d5e2690 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -722,6 +722,25 @@ swayc_t *container_under_pointer(void) {
722 return lookup; 722 return lookup;
723} 723}
724 724
725swayc_t *container_find(swayc_t *container, bool (*f)(swayc_t *, const void *), const void *data) {
726 if (container->children == NULL || container->children->length == 0) {
727 return NULL;
728 }
729
730 for (int i = 0; i < container->children->length; ++i) {
731 if (f(container->children->items[i], data)) {
732 return container->children->items[i];
733 }
734
735 swayc_t *find = container_find(container->children->items[i], f, data);
736 if (find != NULL) {
737 return find;
738 }
739 }
740
741 return NULL;
742}
743
725// Container information 744// Container information
726 745
727bool swayc_is_fullscreen(swayc_t *view) { 746bool swayc_is_fullscreen(swayc_t *view) {