summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {
439 // Check if there's any `assign` criteria for the view 439 // Check if there's any `assign` criteria for the view
440 list_t *criterias = criteria_for_view(view, 440 list_t *criterias = criteria_for_view(view,
441 CT_ASSIGN_WORKSPACE | CT_ASSIGN_OUTPUT); 441 CT_ASSIGN_WORKSPACE | CT_ASSIGN_OUTPUT);
442 struct sway_container *workspace = NULL;
442 if (criterias->length) { 443 if (criterias->length) {
443 struct criteria *criteria = criterias->items[0]; 444 struct criteria *criteria = criterias->items[0];
444 if (criteria->type == CT_ASSIGN_WORKSPACE) { 445 if (criteria->type == CT_ASSIGN_WORKSPACE) {
445 struct sway_container *workspace = workspace_by_name(criteria->target); 446 workspace = workspace_by_name(criteria->target);
446 if (!workspace) { 447 if (!workspace) {
447 workspace = workspace_create(NULL, criteria->target); 448 workspace = workspace_create(NULL, criteria->target);
448 } 449 }
@@ -469,6 +470,9 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
469 470
470 arrange_children_of(cont->parent); 471 arrange_children_of(cont->parent);
471 input_manager_set_focus(input_manager, cont); 472 input_manager_set_focus(input_manager, cont);
473 if (workspace) {
474 workspace_switch(workspace);
475 }
472 476
473 view_update_title(view, false); 477 view_update_title(view, false);
474 container_notify_subtree_changed(view->swayc->parent); 478 container_notify_subtree_changed(view->swayc->parent);