Merge branch 'master' into master

This commit is contained in:
Brian Ashworth 2018-08-08 15:26:44 -04:00 committed by GitHub
commit 3c26536267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 697 additions and 281 deletions

View file

@ -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);