diff options
author | Drew DeVault <[email protected]> | 2018-08-06 11:30:14 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2018-08-06 11:30:14 -0400 |
commit | 1a8bee68b40f641f57adc97d0f2ffcf5e2ed544d (patch) | |
tree | 3df803a95c0a13f4dc9b627db505ba50d5e6a6d2 /sway/tree/view.c | |
parent | 0cd418ba42bf7fa9570a2c1c09cea153d3337c7a (diff) | |
parent | f7c21451dfa7c4ffdce1307b5856707a0ed40405 (diff) |
Merge pull request #2392 from ianyfan/commands
Fix commands: criteria, layout, move, workspace
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 9465b3a1..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 { @@ -891,6 +898,15 @@ static bool find_by_mark_iterator(struct sway_container *con, return con->type == C_VIEW && view_has_mark(con->sway_view, mark); } +struct sway_view *view_find_mark(char *mark) { + struct sway_container *container = container_find(&root_container, + find_by_mark_iterator, mark); + if (!container) { + return NULL; + } + return container->sway_view; +} + bool view_find_and_unmark(char *mark) { struct sway_container *container = container_find(&root_container, find_by_mark_iterator, mark); |