aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-08-06 12:46:28 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-08-06 14:17:58 +0100
commitf7c21451dfa7c4ffdce1307b5856707a0ed40405 (patch)
tree3df803a95c0a13f4dc9b627db505ba50d5e6a6d2 /sway/tree/view.c
parentcommands: check for special workspaces in workspace & move commands (diff)
downloadsway-f7c21451dfa7c4ffdce1307b5856707a0ed40405.tar.gz
sway-f7c21451dfa7c4ffdce1307b5856707a0ed40405.tar.zst
sway-f7c21451dfa7c4ffdce1307b5856707a0ed40405.zip
commands: fix workspace edge cases
Diffstat (limited to 'sway/tree/view.c')
-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 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <stdlib.h> 2#include <stdlib.h>
3#include <strings.h>
3#include <wayland-server.h> 4#include <wayland-server.h>
4#include <wlr/render/wlr_renderer.h> 5#include <wlr/render/wlr_renderer.h>
5#include <wlr/types/wlr_buffer.h> 6#include <wlr/types/wlr_buffer.h>
@@ -456,7 +457,13 @@ static struct sway_container *select_workspace(struct sway_view *view) {
456 if (criteria->type == CT_ASSIGN_WORKSPACE) { 457 if (criteria->type == CT_ASSIGN_WORKSPACE) {
457 ws = workspace_by_name(criteria->target); 458 ws = workspace_by_name(criteria->target);
458 if (!ws) { 459 if (!ws) {
459 ws = workspace_create(NULL, criteria->target); 460 if (strcasecmp(criteria->target, "back_and_forth") == 0) {
461 if (prev_workspace_name) {
462 ws = workspace_create(NULL, prev_workspace_name);
463 }
464 } else {
465 ws = workspace_create(NULL, criteria->target);
466 }
460 } 467 }
461 break; 468 break;
462 } else { 469 } else {