diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index c60c8f8f..dbe88028 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -387,16 +387,16 @@ struct sway_container *tiling_container_at(struct sway_node *parent, } static bool surface_is_popup(struct wlr_surface *surface) { - while (!wlr_surface_is_xdg_surface(surface)) { - if (!wlr_surface_is_subsurface(surface)) { + while (wlr_xdg_surface_try_from_wlr_surface(surface) == NULL) { + struct wlr_subsurface *subsurface = + wlr_subsurface_try_from_wlr_surface(surface); + if (subsurface == NULL) { return false; } - struct wlr_subsurface *subsurface = - wlr_subsurface_from_wlr_surface(surface); surface = subsurface->parent; } struct wlr_xdg_surface *xdg_surface = - wlr_xdg_surface_from_wlr_surface(surface); + wlr_xdg_surface_try_from_wlr_surface(surface); return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP; } |