aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-10-11 08:24:38 -0400
committerGitHub <noreply@github.com>2016-10-11 08:24:38 -0400
commitce713efcd23b82a7d85c1976ddfbd46f08133ff6 (patch)
treec7e0986aa282c00bcc12cde70820ffbca07cb6b5 /sway/container.c
parent9ad6fc592dd6bd5bf29e60b03186bba32f5c9fa3 (diff)
parent166c2a3687d2819184457490132dd0c109238873 (diff)
Merge pull request #945 from thejan2009/workspace_layout
Fixes dealing with workspace_layout and related bugs [rfc]
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sway/container.c b/sway/container.c
index 4f22eb0d..c588f3db 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -27,6 +27,7 @@ static swayc_t *new_swayc(enum swayc_types type) {
c->handle = -1;
c->gaps = -1;
c->layout = L_NONE;
+ c->workspace_layout = L_NONE;
c->type = type;
if (type != C_VIEW) {
c->children = create_list();
@@ -209,7 +210,8 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
swayc_t *workspace = new_swayc(C_WORKSPACE);
workspace->prev_layout = L_NONE;
- workspace->layout = default_layout(output);
+ workspace->layout = L_HORIZ;
+ workspace->workspace_layout = default_layout(output);
workspace->x = output->x;
workspace->y = output->y;
@@ -262,7 +264,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) {
// add container to workspace chidren
add_child(workspace, cont);
// give them proper layouts
- cont->layout = workspace->layout;
+ cont->layout = workspace->workspace_layout;
cont->prev_layout = workspace->prev_layout;
/* TODO: might break shit in move_container!!! workspace->layout = layout; */
set_focused_container_for(workspace, get_focused_view(workspace));
@@ -944,3 +946,12 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) {
}
return NULL;
}
+
+swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout) {
+ if (container->type == C_WORKSPACE) {
+ container->workspace_layout = layout;
+ } else {
+ container->layout = layout;
+ }
+ return container;
+}