mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
Change container_get_first_view signature
This will have the function stop the recusive calls as soon as the first view is found - unlike before
This commit is contained in:
parent
c2eaf01767
commit
88fb849e59
3 changed files with 15 additions and 8 deletions
|
|
@ -430,18 +430,23 @@ struct sway_container *container_at(struct sway_workspace *workspace,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void container_get_first_view(struct sway_container *container,
|
||||
struct sway_container **view) {
|
||||
struct sway_container *container_get_first_view(struct sway_container *container) {
|
||||
if (container->view) {
|
||||
*view = container;
|
||||
return container;
|
||||
}
|
||||
|
||||
if (container->pending.children) {
|
||||
for (int i = 0; i < container->pending.children->length; ++i) {
|
||||
struct sway_container *child = container->pending.children->items[i];
|
||||
container_get_first_view(child, view);
|
||||
struct sway_container *view = container_get_first_view(child);
|
||||
|
||||
if (view) {
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void container_for_each_child(struct sway_container *container,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue