aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-05-25 08:47:08 -0400
committerGitHub <noreply@github.com>2018-05-25 08:47:08 -0400
commitab74c95d56b856bfd2e9e8fd4bd49280f671960f (patch)
treea208bfa3b834bba4f16d09657d59fdb43b8eb1e0 /sway/tree
parentdaf328d0540b3e4919ae726922b68b8edc0fc2a3 (diff)
parentf32a00240143d8696705ba626acd58c581523bbf (diff)
downloadsway-ab74c95d56b856bfd2e9e8fd4bd49280f671960f.tar.xz
Merge pull request #2036 from RyanDwyer/workspace-switch-on-map
Switch workspace if required when mapping a view
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/view.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 2f718a73..812d7740 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -439,10 +439,11 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
// Check if there's any `assign` criteria for the view
list_t *criterias = criteria_for_view(view,
CT_ASSIGN_WORKSPACE | CT_ASSIGN_OUTPUT);
+ struct sway_container *workspace = NULL;
if (criterias->length) {
struct criteria *criteria = criterias->items[0];
if (criteria->type == CT_ASSIGN_WORKSPACE) {
- struct sway_container *workspace = workspace_by_name(criteria->target);
+ workspace = workspace_by_name(criteria->target);
if (!workspace) {
workspace = workspace_create(NULL, criteria->target);
}
@@ -469,6 +470,9 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
arrange_children_of(cont->parent);
input_manager_set_focus(input_manager, cont);
+ if (workspace) {
+ workspace_switch(workspace);
+ }
view_update_title(view, false);
container_notify_subtree_changed(view->swayc->parent);