diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 15:07:07 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 16:18:33 +1000 |
commit | 2b5a404ac920339a2b9ce32d4718272dee4668b9 (patch) | |
tree | 681f45a530a1f8d5966161291c3cb482e52edb6e /sway/commands/swap.c | |
parent | 389d159c81502aa8b951895de11c3720bbd5ba7d (diff) |
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
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r-- | sway/commands/swap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 615e6b1d..f881a002 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c @@ -72,7 +72,7 @@ struct cmd_results *cmd_swap(int argc, char **argv) { || container_has_ancestor(other, current)) { error = cmd_results_new(CMD_FAILURE, "swap", "Cannot swap ancestor and descendant"); - } else if (current->layout == L_FLOATING || other->layout == L_FLOATING) { + } else if (container_is_floating(current) || container_is_floating(other)) { error = cmd_results_new(CMD_FAILURE, "swap", "Swapping with floating containers is not supported"); } |