mirror of
https://github.com/swaywm/sway.git
synced 2025-11-09 13:29:49 -05:00
add click on title_bar to focus a container
This commit is contained in:
parent
0fe2386014
commit
37065cd0c4
3 changed files with 38 additions and 0 deletions
|
|
@ -722,6 +722,25 @@ swayc_t *container_under_pointer(void) {
|
|||
return lookup;
|
||||
}
|
||||
|
||||
swayc_t *container_find(swayc_t *container, bool (*f)(swayc_t *, const void *), const void *data) {
|
||||
if (container->children == NULL || container->children->length == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (int i = 0; i < container->children->length; ++i) {
|
||||
if (f(container->children->items[i], data)) {
|
||||
return container->children->items[i];
|
||||
}
|
||||
|
||||
swayc_t *find = container_find(container->children->items[i], f, data);
|
||||
if (find != NULL) {
|
||||
return find;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Container information
|
||||
|
||||
bool swayc_is_fullscreen(swayc_t *view) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue