diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-25 08:47:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 08:47:08 -0400 |
commit | ab74c95d56b856bfd2e9e8fd4bd49280f671960f (patch) | |
tree | a208bfa3b834bba4f16d09657d59fdb43b8eb1e0 | |
parent | Merge pull request #2033 from RyanDwyer/arrange-after-flatten (diff) | |
parent | Switch workspace if required when mapping a view (diff) | |
download | sway-ab74c95d56b856bfd2e9e8fd4bd49280f671960f.tar.gz sway-ab74c95d56b856bfd2e9e8fd4bd49280f671960f.tar.zst sway-ab74c95d56b856bfd2e9e8fd4bd49280f671960f.zip |
Merge pull request #2036 from RyanDwyer/workspace-switch-on-map
Switch workspace if required when mapping a view
-rw-r--r-- | sway/tree/view.c | 6 |
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); |