aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorRonan Pigott <rpigott@berkeley.edu>2020-10-25 14:20:11 -0700
committerTudor Brindus <me@tbrindus.ca>2020-12-20 00:58:42 -0500
commitece6a1d408456ade74c88dee7d4b9e0491f0bdaf (patch)
tree09f5a40a02347c927a91ab66da6c794cfd787c97 /sway/tree/view.c
parentb4850876dc609830575531fd6e0ca696c956ae94 (diff)
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.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 354f2d34..e690c334 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -732,10 +732,11 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
ws = seat_get_last_known_workspace(seat);
}
+ struct sway_container *container = view->container;
if (target_sibling) {
- container_add_sibling(target_sibling, view->container, 1);
+ container_add_sibling(target_sibling, container, 1);
} else if (ws) {
- workspace_add_tiling(ws, view->container);
+ container = workspace_add_tiling(ws, container);
}
ipc_event_window(view->container, "new");
@@ -759,26 +760,26 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
}
if (config->popup_during_fullscreen == POPUP_LEAVE &&
- view->container->workspace &&
- view->container->workspace->fullscreen &&
- view->container->workspace->fullscreen->view) {
- struct sway_container *fs = view->container->workspace->fullscreen;
+ container->workspace &&
+ container->workspace->fullscreen &&
+ container->workspace->fullscreen->view) {
+ struct sway_container *fs = container->workspace->fullscreen;
if (view_is_transient_for(view, fs->view)) {
container_set_fullscreen(fs, false);
}
}
view_update_title(view, false);
- container_update_representation(view->container);
+ container_update_representation(container);
if (fullscreen) {
container_set_fullscreen(view->container, true);
arrange_workspace(view->container->workspace);
} else {
- if (view->container->parent) {
- arrange_container(view->container->parent);
- } else if (view->container->workspace) {
- arrange_workspace(view->container->workspace);
+ if (container->parent) {
+ arrange_container(container->parent);
+ } else if (container->workspace) {
+ arrange_workspace(container->workspace);
}
}