From 0f79066def8977924a10cf34d5469299ab44fe9d Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Sun, 26 Dec 2021 16:39:46 +0100 Subject: [PATCH] xdg_shell: check role in is_primary --- xdg_shell.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xdg_shell.c b/xdg_shell.c index a51ed70..0a8eda3 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -112,9 +112,12 @@ static bool is_primary(struct cg_view *view) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - struct wlr_xdg_surface *parent = xdg_shell_view->xdg_surface->toplevel->parent; - /* FIXME: role is 0? */ - return parent == NULL; /*&& role == WLR_XDG_SURFACE_ROLE_TOPLEVEL */ + struct wlr_xdg_surface *xdg_surface = xdg_shell_view->xdg_surface; + + struct wlr_xdg_surface *parent = xdg_surface->toplevel->parent; + enum wlr_xdg_surface_role role = xdg_surface->role; + + return parent == NULL && role == WLR_XDG_SURFACE_ROLE_TOPLEVEL; } static bool