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/desktop/xdg_shell.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sway/desktop/xdg_shell.c') diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index f02021e1..fdac6171 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c @@ -349,19 +349,20 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) return; } + struct sway_container *container = view->container; if (e->fullscreen && e->output && e->output->data) { struct sway_output *output = e->output->data; struct sway_workspace *ws = output_get_active_workspace(output); - if (ws && !container_is_scratchpad_hidden(view->container)) { - if (container_is_floating(view->container)) { - workspace_add_floating(ws, view->container); + if (ws && !container_is_scratchpad_hidden(container)) { + if (container_is_floating(container)) { + workspace_add_floating(ws, container); } else { - workspace_add_tiling(ws, view->container); + container = workspace_add_tiling(ws, container); } } } - container_set_fullscreen(view->container, e->fullscreen); + container_set_fullscreen(container, e->fullscreen); arrange_root(); transaction_commit_dirty(); -- cgit v1.2.3