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 --- include/sway/tree/workspace.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/sway/tree/workspace.h') diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index c9dbb538..35c91017 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -9,7 +9,7 @@ struct sway_view; struct sway_workspace { struct sway_container *swayc; struct sway_container *fullscreen; - struct sway_container *floating; + list_t *floating; // struct sway_container list_t *output_priority; bool urgent; }; @@ -63,4 +63,7 @@ struct sway_container *workspace_find_container(struct sway_container *ws, */ struct sway_container *workspace_wrap_children(struct sway_container *ws); +void workspace_add_floating(struct sway_container *workspace, + struct sway_container *con); + #endif -- cgit v1.2.3