From 571321a1d84a1eb2867fbdc39f7f828aa2c64a01 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Mon, 10 Oct 2016 20:44:09 +0200 Subject: add workspace_layout, ensure ws is always L_HORIZ Add swayc_change_layout function, which changes either layout or workspace_layout, depending on the container type. Workspace being always L_HORIZ makes this much more i3-compatible. --- sway/layout.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sway/layout.c') diff --git a/sway/layout.c b/sway/layout.c index 4f2ea09a..a57306e0 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -302,7 +302,8 @@ void move_container(swayc_t *container, enum movement_direction dir) { } // Change parent layout if we need to if (parent->children->length == 1 && parent->layout != layout) { - parent->layout = layout; + swayc_change_layout(parent, layout); + /* parent->layout = layout; */ continue; } if (parent->type == C_WORKSPACE) { -- cgit v1.2.3 From 166c2a3687d2819184457490132dd0c109238873 Mon Sep 17 00:00:00 2001 From: "D.B" Date: Tue, 11 Oct 2016 09:11:56 +0200 Subject: generalize wrapping views under workspaces --- sway/layout.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sway/layout.c') diff --git a/sway/layout.c b/sway/layout.c index a57306e0..8565113d 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -66,6 +66,11 @@ void add_child(swayc_t *parent, swayc_t *child) { if (!parent->focused) { parent->focused = child; } + + // wrap view into a container + if (parent->type == C_WORKSPACE && child->type == C_VIEW) { + new_container(child, parent->workspace_layout); + } } void insert_child(swayc_t *parent, swayc_t *child, int index) { @@ -80,6 +85,11 @@ void insert_child(swayc_t *parent, swayc_t *child, int index) { if (!parent->focused) { parent->focused = child; } + + // wrap view into a container + if (parent->type == C_WORKSPACE && child->type == C_VIEW) { + new_container(child, parent->workspace_layout); + } } void add_floating(swayc_t *ws, swayc_t *child) { -- cgit v1.2.3