mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-10 04:27:53 -05:00
view: add view_has_children to query if a view has children
This allows us to check per-view whether is has dialogs open, instead of diong it on a global basis as we are doing currently. This is necessary for fully supporting multiple primary clients.
This commit is contained in:
parent
112a662ebc
commit
b0bd4e680d
4 changed files with 28 additions and 0 deletions
12
view.c
12
view.c
|
|
@ -68,6 +68,18 @@ view_is_primary(struct cg_view *view)
|
|||
return view->is_primary(view);
|
||||
}
|
||||
|
||||
bool
|
||||
view_has_children(struct cg_server *server, struct cg_view *parent)
|
||||
{
|
||||
struct cg_view *child;
|
||||
wl_list_for_each(child, &server->views, link) {
|
||||
if (parent != child && parent->is_parent(parent, child)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
view_position(struct cg_view *view)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue