diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 8 | ||||
-rw-r--r-- | sway/desktop/render.c | 8 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 17 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 16 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 17 |
5 files changed, 66 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index cfb5a710..adc1ee10 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -329,6 +329,14 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { workspace->current.fullscreen, &data); container_for_each_child(workspace->current.fullscreen, send_frame_done_container_iterator, &data); + for (int i = 0; i < workspace->current.floating->length; ++i) { + struct sway_container *floater = + workspace->current.floating->items[i]; + if (container_is_transient_for(floater, + workspace->current.fullscreen)) { + send_frame_done_container_iterator(floater, &data); + } + } #ifdef HAVE_XWAYLAND send_frame_done_unmanaged(output, &root->xwayland_unmanaged, when); #endif diff --git a/sway/desktop/render.c b/sway/desktop/render.c index c8b08a58..3617da87 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -961,6 +961,14 @@ void output_render(struct sway_output *output, struct timespec *when, render_container(output, damage, fullscreen_con, fullscreen_con->current.focused); } + + for (int i = 0; i < workspace->current.floating->length; ++i) { + struct sway_container *floater = + workspace->current.floating->items[i]; + if (container_is_transient_for(floater, fullscreen_con)) { + render_floating_container(output, damage, floater); + } + } #ifdef HAVE_XWAYLAND render_unmanaged(output, damage, &root->xwayland_unmanaged); #endif diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 2e2815c1..46582204 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c @@ -207,6 +207,21 @@ static void for_each_popup(struct sway_view *view, wlr_xdg_surface_for_each_popup(view->wlr_xdg_surface, iterator, user_data); } +static bool is_transient_for(struct sway_view *child, + struct sway_view *ancestor) { + if (xdg_shell_view_from_view(child) == NULL) { + return false; + } + struct wlr_xdg_surface *surface = child->wlr_xdg_surface; + while (surface) { + if (surface->toplevel->parent == ancestor->wlr_xdg_surface) { + return true; + } + surface = surface->toplevel->parent; + } + return false; +} + static void _close(struct sway_view *view) { if (xdg_shell_view_from_view(view) == NULL) { return; @@ -248,6 +263,7 @@ static const struct sway_view_impl view_impl = { .wants_floating = wants_floating, .for_each_surface = for_each_surface, .for_each_popup = for_each_popup, + .is_transient_for = is_transient_for, .close = _close, .close_popups = close_popups, .destroy = destroy, @@ -410,6 +426,7 @@ static void handle_map(struct wl_listener *listener, void *data) { arrange_workspace(view->container->workspace); } } + transaction_commit_dirty(); xdg_shell_view->commit.notify = handle_commit; diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index e61bd652..165cc7eb 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c @@ -204,6 +204,21 @@ static void for_each_popup(struct sway_view *view, user_data); } +static bool is_transient_for(struct sway_view *child, + struct sway_view *ancestor) { + if (xdg_shell_v6_view_from_view(child) == NULL) { + return false; + } + struct wlr_xdg_surface_v6 *surface = child->wlr_xdg_surface_v6; + while (surface) { + if (surface->toplevel->parent == ancestor->wlr_xdg_surface_v6) { + return true; + } + surface = surface->toplevel->parent; + } + return false; +} + static void _close(struct sway_view *view) { if (xdg_shell_v6_view_from_view(view) == NULL) { return; @@ -245,6 +260,7 @@ static const struct sway_view_impl view_impl = { .wants_floating = wants_floating, .for_each_surface = for_each_surface, .for_each_popup = for_each_popup, + .is_transient_for = is_transient_for, .close = _close, .close_popups = close_popups, .destroy = destroy, 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 @@ #include "sway/tree/arrange.h" #include "sway/tree/container.h" #include "sway/tree/view.h" +#include "sway/tree/workspace.h" static const char *atom_map[ATOM_LAST] = { "_NET_WM_WINDOW_TYPE_NORMAL", @@ -253,6 +254,21 @@ static void handle_set_decorations(struct wl_listener *listener, void *data) { view_update_csd_from_client(view, csd); } +static bool is_transient_for(struct sway_view *child, + struct sway_view *ancestor) { + if (xwayland_view_from_view(child) == NULL) { + return false; + } + struct wlr_xwayland_surface *surface = child->wlr_xwayland_surface; + while (surface) { + if (surface->parent == ancestor->wlr_xwayland_surface) { + return true; + } + surface = surface->parent; + } + return false; +} + static void _close(struct sway_view *view) { if (xwayland_view_from_view(view) == NULL) { return; @@ -276,6 +292,7 @@ static const struct sway_view_impl view_impl = { .set_tiled = set_tiled, .set_fullscreen = set_fullscreen, .wants_floating = wants_floating, + .is_transient_for = is_transient_for, .close = _close, .destroy = destroy, }; |