summaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 06cef900..950494d8 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 {
@@ -891,6 +898,15 @@ static bool find_by_mark_iterator(struct sway_container *con,
891 return con->type == C_VIEW && view_has_mark(con->sway_view, mark); 898 return con->type == C_VIEW && view_has_mark(con->sway_view, mark);
892} 899}
893 900
901struct sway_view *view_find_mark(char *mark) {
902 struct sway_container *container = container_find(&root_container,
903 find_by_mark_iterator, mark);
904 if (!container) {
905 return NULL;
906 }
907 return container->sway_view;
908}
909
894bool view_find_and_unmark(char *mark) { 910bool view_find_and_unmark(char *mark) {
895 struct sway_container *container = container_find(&root_container, 911 struct sway_container *container = container_find(&root_container,
896 find_by_mark_iterator, mark); 912 find_by_mark_iterator, mark);