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/commands/floating.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sway/commands/floating.c') diff --git a/sway/commands/floating.c b/sway/commands/floating.c index c9467ef0..beafd9fb 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c @@ -33,7 +33,7 @@ struct cmd_results *cmd_floating(int argc, char **argv) { // If the container is in a floating split container, // operate on the split container instead of the child. if (container_is_floating_or_child(container)) { - while (container->parent->layout != L_FLOATING) { + while (container->parent->type != C_WORKSPACE) { container = container->parent; } } -- cgit v1.2.3