From ece6a1d408456ade74c88dee7d4b9e0491f0bdaf Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Sun, 25 Oct 2020 14:20:11 -0700 Subject: Change workspace_layout to match i3 behavior In i3, the workspace_layout command does not affect the workspace layout. Instead, new workspace level containers are wrapped in the desired layout and the workspace layout always defaults to the output orientation. --- sway/tree/container.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sway/tree/container.c') diff --git a/sway/tree/container.c b/sway/tree/container.c index b0d23700..23b6c997 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -804,9 +804,10 @@ void container_set_floating(struct sway_container *container, bool enable) { container->width = reference->width; container->height = reference->height; } else { - workspace_add_tiling(workspace, container); - container->width = workspace->width; - container->height = workspace->height; + struct sway_container *other = + workspace_add_tiling(workspace, container); + other->width = workspace->width; + other->height = workspace->height; } if (container->view) { view_set_tiled(container->view, true); -- cgit v1.2.3