diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 15:40:40 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-02 15:40:40 -0400 |
commit | d070244362f7d34bc15418154e52f8c968fbad41 (patch) | |
tree | 6817e56203e5241d4a3231b231f4e2cbe567b51d /sway/commands/split.c | |
parent | address feedback (diff) | |
download | sway-d070244362f7d34bc15418154e52f8c968fbad41.tar.gz sway-d070244362f7d34bc15418154e52f8c968fbad41.tar.zst sway-d070244362f7d34bc15418154e52f8c968fbad41.zip |
fix workspace splits
Diffstat (limited to 'sway/commands/split.c')
-rw-r--r-- | sway/commands/split.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/sway/commands/split.c b/sway/commands/split.c index fe4013e9..ca116aef 100644 --- a/sway/commands/split.c +++ b/sway/commands/split.c | |||
@@ -25,29 +25,8 @@ static struct cmd_results *_do_split(int argc, char **argv, int layout) { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | struct sway_container *focused = config->handler_context.current_container; | 27 | struct sway_container *focused = config->handler_context.current_container; |
28 | 28 | struct sway_container *parent = container_split(focused, layout); | |
29 | // TODO floating: dont split | 29 | arrange_windows(parent, -1, -1); |
30 | |||
31 | /* Case that focus is on an workspace with 0/1 children.change its layout */ | ||
32 | if (focused->type == C_WORKSPACE && focused->children->length <= 1) { | ||
33 | wlr_log(L_DEBUG, "changing workspace layout"); | ||
34 | container_set_layout(focused, layout); | ||
35 | } else if (focused->type != C_WORKSPACE && | ||
36 | focused->parent->children->length == 1) { | ||
37 | /* Case of no siblings. change parent layout */ | ||
38 | wlr_log(L_DEBUG, "changing container layout"); | ||
39 | container_set_layout(focused->parent, layout); | ||
40 | } else { | ||
41 | // regular case where new split container is build around focused | ||
42 | // container or in case of workspace, container inherits its children | ||
43 | wlr_log(L_DEBUG, | ||
44 | "Adding new container around current focused container"); | ||
45 | wlr_log(L_INFO, "FOCUSED SIZE: %.f %.f", | ||
46 | focused->width, focused->height); | ||
47 | |||
48 | struct sway_container *parent = container_split(focused, layout); | ||
49 | arrange_windows(parent, -1, -1); | ||
50 | } | ||
51 | 30 | ||
52 | // TODO borders: update borders | 31 | // TODO borders: update borders |
53 | 32 | ||