From a8e15442ab8c742fd33a0fbb9210ad466cd68b41 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Fri, 18 Jan 2019 17:13:48 +0100 Subject: [PATCH] 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. --- xdg_shell.c | 3 +++ xwayland.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xdg_shell.c b/xdg_shell.c index 23be4aa..8eccae3 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -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; } diff --git a/xwayland.c b/xwayland.c index 64eb58c..7418f7b 100644 --- a/xwayland.c +++ b/xwayland.c @@ -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; }