diff options
-rw-r--r-- | sway/tree/container.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 6a01eab3..943d3d53 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -382,19 +382,17 @@ struct sway_container *tiling_container_at(struct sway_node *parent, | |||
382 | } | 382 | } |
383 | 383 | ||
384 | static bool surface_is_popup(struct wlr_surface *surface) { | 384 | static bool surface_is_popup(struct wlr_surface *surface) { |
385 | if (wlr_surface_is_xdg_surface(surface)) { | 385 | while (!wlr_surface_is_xdg_surface(surface)) { |
386 | struct wlr_xdg_surface *xdg_surface = | 386 | if (!wlr_surface_is_subsurface(surface)) { |
387 | wlr_xdg_surface_from_wlr_surface(surface); | 387 | return false; |
388 | while (xdg_surface && xdg_surface->role != WLR_XDG_SURFACE_ROLE_NONE) { | ||
389 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { | ||
390 | return true; | ||
391 | } | ||
392 | xdg_surface = xdg_surface->toplevel->parent; | ||
393 | } | 388 | } |
394 | return false; | 389 | struct wlr_subsurface *subsurface = |
390 | wlr_subsurface_from_wlr_surface(surface); | ||
391 | surface = subsurface->parent; | ||
395 | } | 392 | } |
396 | 393 | struct wlr_xdg_surface *xdg_surface = | |
397 | return false; | 394 | wlr_xdg_surface_from_wlr_surface(surface); |
395 | return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP; | ||
398 | } | 396 | } |
399 | 397 | ||
400 | struct sway_container *container_at(struct sway_workspace *workspace, | 398 | struct sway_container *container_at(struct sway_workspace *workspace, |