diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/output.c | 31 | ||||
-rw-r--r-- | sway/desktop/render.c | 5 | ||||
-rw-r--r-- | sway/desktop/transaction.c | 4 |
3 files changed, 14 insertions, 26 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 1e4f196b..2253eb51 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -316,31 +316,21 @@ static void send_frame_done_container_iterator(struct sway_container *con, send_frame_done_iterator, data->when); } -static void send_frame_done_container(struct sway_output *output, - struct sway_container *con, struct timespec *when) { - struct send_frame_done_data data = { - .output = output, - .when = when, - }; - output_for_each_container(output->swayc, - send_frame_done_container_iterator, &data); -} - static void send_frame_done(struct sway_output *output, struct timespec *when) { if (output_has_opaque_overlay_layer_surface(output)) { goto send_frame_overlay; } + struct send_frame_done_data data = { + .output = output, + .when = when, + }; struct sway_container *workspace = output_get_active_workspace(output); if (workspace->current.ws_fullscreen) { - if (workspace->current.ws_fullscreen->type == C_VIEW) { - output_view_for_each_surface(output, - workspace->current.ws_fullscreen->sway_view, - send_frame_done_iterator, when); - } else { - send_frame_done_container(output, workspace->current.ws_fullscreen, - when); - } + send_frame_done_container_iterator( + workspace->current.ws_fullscreen, &data); + container_for_each_child(workspace->current.ws_fullscreen, + send_frame_done_container_iterator, &data); #ifdef HAVE_XWAYLAND send_frame_done_unmanaged(output, &root_container.sway_root->xwayland_unmanaged, when); @@ -351,9 +341,8 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { send_frame_done_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], when); - send_frame_done_container(output, workspace, when); - send_frame_done_container(output, workspace->sway_workspace->floating, - when); + workspace_for_each_container(workspace, + send_frame_done_container_iterator, &data); #ifdef HAVE_XWAYLAND send_frame_done_unmanaged(output, diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 7c48d0d2..aa70903e 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -754,8 +754,6 @@ static void render_container(struct sway_output *output, case L_TABBED: render_container_tabbed(output, damage, con, parent_focused); break; - case L_FLOATING: - sway_assert(false, "Didn't expect to see floating here"); } } @@ -806,8 +804,7 @@ static void render_floating(struct sway_output *soutput, if (!workspace_is_visible(ws)) { continue; } - list_t *floating = - ws->current.ws_floating->current.children; + list_t *floating = ws->current.ws_floating; for (int k = 0; k < floating->length; ++k) { struct sway_container *floater = floating->items[k]; render_floating_container(soutput, damage, floater); diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index c300558a..692fb447 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -111,8 +111,9 @@ static void copy_pending_state(struct sway_container *container, state->using_csd = view->using_csd; } else if (container->type == C_WORKSPACE) { state->ws_fullscreen = container->sway_workspace->fullscreen; - state->ws_floating = container->sway_workspace->floating; + state->ws_floating = create_list(); state->children = create_list(); + list_cat(state->ws_floating, container->sway_workspace->floating); list_cat(state->children, container->children); } else { state->children = create_list(); @@ -189,6 +190,7 @@ static void transaction_apply(struct sway_transaction *transaction) { // Any child containers which are being deleted will be cleaned up in // transaction_destroy(). list_free(container->current.children); + list_free(container->current.ws_floating); memcpy(&container->current, &instruction->state, sizeof(struct sway_container_state)); |