aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-08-06 12:46:28 +0100
committerIan Fan <ianfan0@gmail.com>2018-08-06 14:17:58 +0100
commitf7c21451dfa7c4ffdce1307b5856707a0ed40405 (patch)
tree3df803a95c0a13f4dc9b627db505ba50d5e6a6d2 /sway/tree
parent667b8dcb67d8c3f15b52f59d228bb3146a5cdb30 (diff)
downloadsway-f7c21451dfa7c4ffdce1307b5856707a0ed40405.tar.xz
commands: fix workspace edge cases
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/view.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 48bd7ac0..faaa53a1 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -1,5 +1,6 @@
#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
+#include <strings.h>
#include <wayland-server.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_buffer.h>
@@ -456,7 +457,13 @@ static struct sway_container *select_workspace(struct sway_view *view) {
if (criteria->type == CT_ASSIGN_WORKSPACE) {
ws = workspace_by_name(criteria->target);
if (!ws) {
- ws = workspace_create(NULL, criteria->target);
+ if (strcasecmp(criteria->target, "back_and_forth") == 0) {
+ if (prev_workspace_name) {
+ ws = workspace_create(NULL, prev_workspace_name);
+ }
+ } else {
+ ws = workspace_create(NULL, criteria->target);
+ }
}
break;
} else {