aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-10-11 08:24:38 -0400
committerLibravatar GitHub <noreply@github.com>2016-10-11 08:24:38 -0400
commitce713efcd23b82a7d85c1976ddfbd46f08133ff6 (patch)
treec7e0986aa282c00bcc12cde70820ffbca07cb6b5 /sway/container.c
parentMerge pull request #948 from thejan2009/floating-titlebar-click (diff)
parentgeneralize wrapping views under workspaces (diff)
downloadsway-ce713efcd23b82a7d85c1976ddfbd46f08133ff6.tar.gz
sway-ce713efcd23b82a7d85c1976ddfbd46f08133ff6.tar.zst
sway-ce713efcd23b82a7d85c1976ddfbd46f08133ff6.zip
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) {
27 c->handle = -1; 27 c->handle = -1;
28 c->gaps = -1; 28 c->gaps = -1;
29 c->layout = L_NONE; 29 c->layout = L_NONE;
30 c->workspace_layout = L_NONE;
30 c->type = type; 31 c->type = type;
31 if (type != C_VIEW) { 32 if (type != C_VIEW) {
32 c->children = create_list(); 33 c->children = create_list();
@@ -209,7 +210,8 @@ swayc_t *new_workspace(swayc_t *output, const char *name) {
209 swayc_t *workspace = new_swayc(C_WORKSPACE); 210 swayc_t *workspace = new_swayc(C_WORKSPACE);
210 211
211 workspace->prev_layout = L_NONE; 212 workspace->prev_layout = L_NONE;
212 workspace->layout = default_layout(output); 213 workspace->layout = L_HORIZ;
214 workspace->workspace_layout = default_layout(output);
213 215
214 workspace->x = output->x; 216 workspace->x = output->x;
215 workspace->y = output->y; 217 workspace->y = output->y;
@@ -262,7 +264,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) {
262 // add container to workspace chidren 264 // add container to workspace chidren
263 add_child(workspace, cont); 265 add_child(workspace, cont);
264 // give them proper layouts 266 // give them proper layouts
265 cont->layout = workspace->layout; 267 cont->layout = workspace->workspace_layout;
266 cont->prev_layout = workspace->prev_layout; 268 cont->prev_layout = workspace->prev_layout;
267 /* TODO: might break shit in move_container!!! workspace->layout = layout; */ 269 /* TODO: might break shit in move_container!!! workspace->layout = layout; */
268 set_focused_container_for(workspace, get_focused_view(workspace)); 270 set_focused_container_for(workspace, get_focused_view(workspace));
@@ -944,3 +946,12 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) {
944 } 946 }
945 return NULL; 947 return NULL;
946} 948}
949
950swayc_t *swayc_change_layout(swayc_t *container, enum swayc_layouts layout) {
951 if (container->type == C_WORKSPACE) {
952 container->workspace_layout = layout;
953 } else {
954 container->layout = layout;
955 }
956 return container;
957}