From 2b5a404ac920339a2b9ce32d4718272dee4668b9 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 19 Aug 2018 15:07:07 +1000 Subject: Replace hacky L_FLOATING container with a list Workspaces previously had a magical `workspace->floating` container, which had a layout of L_FLOATING and whose children were actual floating views. This allowed some conveniences, but was a hacky solution because the container has to be exempt from focus, coordinate transactions with the workspace, and omit emitting IPC events (which we didn't do). This commit changes it to be a list directly in the sway_workspace. The L_FLOATING layout is no longer used so this has been removed as well. * Fixes incorrect check in the swap command (it checked if the containers had the L_FLOATING layout, but this layout applied to the magical container). * Introduces workspace_add_floating --- sway/desktop/render.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sway/desktop/render.c') 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); -- cgit v1.2.3-54-g00ecf