diff options
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index a7838c0f..ff950c70 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -189,6 +189,21 @@ static void for_each_popup(struct sway_view *view, | |||
189 | user_data); | 189 | user_data); |
190 | } | 190 | } |
191 | 191 | ||
192 | static bool is_transient_for(struct sway_view *child, | ||
193 | struct sway_view *ancestor) { | ||
194 | if (xdg_shell_v6_view_from_view(child) == NULL) { | ||
195 | return false; | ||
196 | } | ||
197 | struct wlr_xdg_surface_v6 *surface = child->wlr_xdg_surface_v6; | ||
198 | while (surface) { | ||
199 | if (surface->toplevel->parent == ancestor->wlr_xdg_surface_v6) { | ||
200 | return true; | ||
201 | } | ||
202 | surface = surface->toplevel->parent; | ||
203 | } | ||
204 | return false; | ||
205 | } | ||
206 | |||
192 | static void _close(struct sway_view *view) { | 207 | static void _close(struct sway_view *view) { |
193 | if (xdg_shell_v6_view_from_view(view) == NULL) { | 208 | if (xdg_shell_v6_view_from_view(view) == NULL) { |
194 | return; | 209 | return; |
@@ -230,6 +245,7 @@ static const struct sway_view_impl view_impl = { | |||
230 | .wants_floating = wants_floating, | 245 | .wants_floating = wants_floating, |
231 | .for_each_surface = for_each_surface, | 246 | .for_each_surface = for_each_surface, |
232 | .for_each_popup = for_each_popup, | 247 | .for_each_popup = for_each_popup, |
248 | .is_transient_for = is_transient_for, | ||
233 | .close = _close, | 249 | .close = _close, |
234 | .close_popups = close_popups, | 250 | .close_popups = close_popups, |
235 | .destroy = destroy, | 251 | .destroy = destroy, |