From 57c28f96fd38d05f4374a3ae20b694b6440b3261 Mon Sep 17 00:00:00 2001 From: Taiyu Date: Thu, 13 Aug 2015 12:02:56 -0700 Subject: [PATCH 1/3] split workspace bug --- sway/commands.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/commands.c b/sway/commands.c index da33c5de..2e28e69d 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -235,6 +235,10 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay return false; } swayc_t *focused = get_focused_container(&root_container); + if (focused->type == C_WORKSPACE) { + sway_log(L_DEBUG, "Dont split workspaces"); + return true; + } swayc_t *parent = focused->parent; sway_log(L_DEBUG, "Splitting %p vertically with %p", parent, focused); int index = remove_container_from_parent(parent, focused); From e3edab8a4c5d0257874534b01f52956ec13e7ccc Mon Sep 17 00:00:00 2001 From: Taiyu Date: Thu, 13 Aug 2015 12:23:56 -0700 Subject: [PATCH 2/3] change workspace layout when trying to split it --- sway/commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/commands.c b/sway/commands.c index 2e28e69d..0935cafc 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -237,6 +237,9 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay swayc_t *focused = get_focused_container(&root_container); if (focused->type == C_WORKSPACE) { sway_log(L_DEBUG, "Dont split workspaces"); + if(focused->children->length == 0) { + focused->layout = layout; + } return true; } swayc_t *parent = focused->parent; From 7d294213d1bcfd90052a533588e7d29d1aa96e88 Mon Sep 17 00:00:00 2001 From: Taiyu Date: Thu, 13 Aug 2015 12:26:39 -0700 Subject: [PATCH 3/3] style --- sway/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/commands.c b/sway/commands.c index 0935cafc..0adda3e7 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -237,7 +237,7 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay swayc_t *focused = get_focused_container(&root_container); if (focused->type == C_WORKSPACE) { sway_log(L_DEBUG, "Dont split workspaces"); - if(focused->children->length == 0) { + if (focused->children->length == 0) { focused->layout = layout; } return true;