xdg_shell/xwayland: do not check parent for other view types

An xdg-shell surface can never be a parent of an xwayland surface and
vice-versa.
This commit is contained in:
Jente Hidskes 2019-01-18 17:13:48 +01:00
parent 5deb7776fc
commit a8e15442ab
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA
2 changed files with 6 additions and 0 deletions

View file

@ -61,6 +61,9 @@ is_primary(struct cg_view *view)
static bool
is_parent(struct cg_view *parent, struct cg_view *child)
{
if (child->type != CAGE_XDG_SHELL_VIEW) {
return false;
}
return child->xdg_surface->toplevel->parent == parent->xdg_surface;
}

View file

@ -57,6 +57,9 @@ is_primary(struct cg_view *view)
static bool
is_parent(struct cg_view *parent, struct cg_view *child)
{
if (child->type != CAGE_XWAYLAND_VIEW) {
return false;
}
return child->xwayland_surface->parent == parent->xwayland_surface;
}