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
|
|
@ -58,6 +58,12 @@ is_primary(struct cg_view *view)
|
|||
return parent == NULL; /*&& role == WLR_XDG_SURFACE_ROLE_TOPLEVEL */
|
||||
}
|
||||
|
||||
static bool
|
||||
is_parent(struct cg_view *parent, struct cg_view *child)
|
||||
{
|
||||
return child->xdg_surface->toplevel->parent == parent->xdg_surface;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_xdg_shell_surface_unmap(struct wl_listener *listener, void *data)
|
||||
{
|
||||
|
|
@ -106,4 +112,5 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data)
|
|||
view->for_each_surface = for_each_surface;
|
||||
view->wlr_surface_at = wlr_surface_at;
|
||||
view->is_primary = is_primary;
|
||||
view->is_parent = is_parent;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue