diff options
-rw-r--r-- | sway/desktop/xdg_shell.c | 2 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 2 | ||||
-rw-r--r-- | sway/tree/container.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index b5dcfb0f..152bd26f 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -216,7 +216,7 @@ static bool is_transient_for(struct sway_view *child, | |||
216 | return false; | 216 | return false; |
217 | } | 217 | } |
218 | struct wlr_xdg_surface *surface = child->wlr_xdg_surface; | 218 | struct wlr_xdg_surface *surface = child->wlr_xdg_surface; |
219 | while (surface) { | 219 | while (surface && surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { |
220 | if (surface->toplevel->parent == ancestor->wlr_xdg_surface) { | 220 | if (surface->toplevel->parent == ancestor->wlr_xdg_surface) { |
221 | return true; | 221 | return true; |
222 | } | 222 | } |
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index a7ea163f..3eed54ab 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -213,7 +213,7 @@ static bool is_transient_for(struct sway_view *child, | |||
213 | return false; | 213 | return false; |
214 | } | 214 | } |
215 | struct wlr_xdg_surface_v6 *surface = child->wlr_xdg_surface_v6; | 215 | struct wlr_xdg_surface_v6 *surface = child->wlr_xdg_surface_v6; |
216 | while (surface) { | 216 | while (surface && surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) { |
217 | if (surface->toplevel->parent == ancestor->wlr_xdg_surface_v6) { | 217 | if (surface->toplevel->parent == ancestor->wlr_xdg_surface_v6) { |
218 | return true; | 218 | return true; |
219 | } | 219 | } |
diff --git a/sway/tree/container.c b/sway/tree/container.c index e20e44d4..0415d63c 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -341,7 +341,7 @@ static bool surface_is_popup(struct wlr_surface *surface) { | |||
341 | if (wlr_surface_is_xdg_surface(surface)) { | 341 | if (wlr_surface_is_xdg_surface(surface)) { |
342 | struct wlr_xdg_surface *xdg_surface = | 342 | struct wlr_xdg_surface *xdg_surface = |
343 | wlr_xdg_surface_from_wlr_surface(surface); | 343 | wlr_xdg_surface_from_wlr_surface(surface); |
344 | while (xdg_surface) { | 344 | while (xdg_surface && xdg_surface->role != WLR_XDG_SURFACE_ROLE_NONE) { |
345 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { | 345 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) { |
346 | return true; | 346 | return true; |
347 | } | 347 | } |
@@ -353,7 +353,8 @@ static bool surface_is_popup(struct wlr_surface *surface) { | |||
353 | if (wlr_surface_is_xdg_surface_v6(surface)) { | 353 | if (wlr_surface_is_xdg_surface_v6(surface)) { |
354 | struct wlr_xdg_surface_v6 *xdg_surface_v6 = | 354 | struct wlr_xdg_surface_v6 *xdg_surface_v6 = |
355 | wlr_xdg_surface_v6_from_wlr_surface(surface); | 355 | wlr_xdg_surface_v6_from_wlr_surface(surface); |
356 | while (xdg_surface_v6) { | 356 | while (xdg_surface_v6 && |
357 | xdg_surface_v6->role != WLR_XDG_SURFACE_V6_ROLE_NONE) { | ||
357 | if (xdg_surface_v6->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { | 358 | if (xdg_surface_v6->role == WLR_XDG_SURFACE_V6_ROLE_POPUP) { |
358 | return true; | 359 | return true; |
359 | } | 360 | } |