diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-26 10:14:18 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-26 10:14:18 +1000 |
commit | ae39d7b28caa30652c0e48fda453f509e8e8d784 (patch) | |
tree | a61a0fb433462d42b48a23fb58dd3b2a3bc778d8 /sway/tree/layout.c | |
parent | Merge pull request #1852 from RyanDwyer/criteria-commands (diff) | |
download | sway-ae39d7b28caa30652c0e48fda453f509e8e8d784.tar.gz sway-ae39d7b28caa30652c0e48fda453f509e8e8d784.tar.zst sway-ae39d7b28caa30652c0e48fda453f509e8e8d784.zip |
Remove sway_container.workspace_layout
Fixes #1716.
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 12af7172..a64cc9a9 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -33,19 +33,6 @@ static void output_layout_handle_change(struct wl_listener *listener, | |||
33 | arrange_windows(&root_container, layout_box->width, layout_box->height); | 33 | arrange_windows(&root_container, layout_box->width, layout_box->height); |
34 | } | 34 | } |
35 | 35 | ||
36 | struct sway_container *container_set_layout(struct sway_container *container, | ||
37 | enum sway_container_layout layout) { | ||
38 | if (container->type == C_WORKSPACE) { | ||
39 | container->workspace_layout = layout; | ||
40 | if (layout == L_HORIZ || layout == L_VERT) { | ||
41 | container->layout = layout; | ||
42 | } | ||
43 | } else { | ||
44 | container->layout = layout; | ||
45 | } | ||
46 | return container; | ||
47 | } | ||
48 | |||
49 | void layout_init(void) { | 36 | void layout_init(void) { |
50 | root_container.id = 0; // normally assigned in new_swayc() | 37 | root_container.id = 0; // normally assigned in new_swayc() |
51 | root_container.type = C_ROOT; | 38 | root_container.type = C_ROOT; |
@@ -305,8 +292,8 @@ static void workspace_rejigger(struct sway_container *ws, | |||
305 | 292 | ||
306 | int index = move_offs(move_dir); | 293 | int index = move_offs(move_dir); |
307 | container_insert_child(ws, child, index < 0 ? 0 : 1); | 294 | container_insert_child(ws, child, index < 0 ? 0 : 1); |
308 | container_set_layout(ws, | 295 | ws->layout = |
309 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT); | 296 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? L_HORIZ : L_VERT; |
310 | 297 | ||
311 | container_flatten(ws); | 298 | container_flatten(ws); |
312 | container_reap_empty_recursive(original_parent); | 299 | container_reap_empty_recursive(original_parent); |
@@ -387,9 +374,9 @@ void container_move(struct sway_container *container, | |||
387 | workspace_rejigger(current, container, move_dir); | 374 | workspace_rejigger(current, container, move_dir); |
388 | } else if (current->children->length == 2) { | 375 | } else if (current->children->length == 2) { |
389 | wlr_log(L_DEBUG, "Changing workspace layout"); | 376 | wlr_log(L_DEBUG, "Changing workspace layout"); |
390 | container_set_layout(current, | 377 | current->layout = |
391 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? | 378 | move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? |
392 | L_HORIZ : L_VERT); | 379 | L_HORIZ : L_VERT; |
393 | container_insert_child(current, container, offs < 0 ? 0 : 1); | 380 | container_insert_child(current, container, offs < 0 ? 0 : 1); |
394 | arrange_windows(current, -1, -1); | 381 | arrange_windows(current, -1, -1); |
395 | } | 382 | } |
@@ -1066,7 +1053,7 @@ struct sway_container *container_split(struct sway_container *child, | |||
1066 | 1053 | ||
1067 | container_add_child(workspace, cont); | 1054 | container_add_child(workspace, cont); |
1068 | enum sway_container_layout old_layout = workspace->layout; | 1055 | enum sway_container_layout old_layout = workspace->layout; |
1069 | container_set_layout(workspace, layout); | 1056 | workspace->layout = layout; |
1070 | cont->layout = old_layout; | 1057 | cont->layout = old_layout; |
1071 | 1058 | ||
1072 | if (set_focus) { | 1059 | if (set_focus) { |