diff options
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 4c710f7e..ebf2131e 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "sway/tree/arrange.h" | 15 | #include "sway/tree/arrange.h" |
16 | #include "sway/tree/container.h" | 16 | #include "sway/tree/container.h" |
17 | #include "sway/tree/view.h" | 17 | #include "sway/tree/view.h" |
18 | #include "sway/tree/workspace.h" | ||
18 | 19 | ||
19 | static const char *atom_map[ATOM_LAST] = { | 20 | static const char *atom_map[ATOM_LAST] = { |
20 | "_NET_WM_WINDOW_TYPE_NORMAL", | 21 | "_NET_WM_WINDOW_TYPE_NORMAL", |
@@ -253,6 +254,21 @@ static void handle_set_decorations(struct wl_listener *listener, void *data) { | |||
253 | view_update_csd_from_client(view, csd); | 254 | view_update_csd_from_client(view, csd); |
254 | } | 255 | } |
255 | 256 | ||
257 | static bool is_transient_for(struct sway_view *child, | ||
258 | struct sway_view *ancestor) { | ||
259 | if (xwayland_view_from_view(child) == NULL) { | ||
260 | return false; | ||
261 | } | ||
262 | struct wlr_xwayland_surface *surface = child->wlr_xwayland_surface; | ||
263 | while (surface) { | ||
264 | if (surface->parent == ancestor->wlr_xwayland_surface) { | ||
265 | return true; | ||
266 | } | ||
267 | surface = surface->parent; | ||
268 | } | ||
269 | return false; | ||
270 | } | ||
271 | |||
256 | static void _close(struct sway_view *view) { | 272 | static void _close(struct sway_view *view) { |
257 | if (xwayland_view_from_view(view) == NULL) { | 273 | if (xwayland_view_from_view(view) == NULL) { |
258 | return; | 274 | return; |
@@ -276,6 +292,7 @@ static const struct sway_view_impl view_impl = { | |||
276 | .set_tiled = set_tiled, | 292 | .set_tiled = set_tiled, |
277 | .set_fullscreen = set_fullscreen, | 293 | .set_fullscreen = set_fullscreen, |
278 | .wants_floating = wants_floating, | 294 | .wants_floating = wants_floating, |
295 | .is_transient_for = is_transient_for, | ||
279 | .close = _close, | 296 | .close = _close, |
280 | .destroy = destroy, | 297 | .destroy = destroy, |
281 | }; | 298 | }; |