diff options
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index c0da9c93..2dbd6346 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -561,8 +561,8 @@ struct sway_workspace *workspace_output_prev( | |||
561 | return workspace_output_prev_next_impl(current->output, -1, create); | 561 | return workspace_output_prev_next_impl(current->output, -1, create); |
562 | } | 562 | } |
563 | 563 | ||
564 | bool workspace_switch(struct sway_workspace *workspace, | 564 | struct sway_workspace *workspace_auto_back_and_forth( |
565 | bool no_auto_back_and_forth) { | 565 | struct sway_workspace *workspace) { |
566 | struct sway_seat *seat = input_manager_current_seat(); | 566 | struct sway_seat *seat = input_manager_current_seat(); |
567 | struct sway_workspace *active_ws = NULL; | 567 | struct sway_workspace *active_ws = NULL; |
568 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); | 568 | struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); |
@@ -572,14 +572,18 @@ bool workspace_switch(struct sway_workspace *workspace, | |||
572 | active_ws = focus->sway_container->pending.workspace; | 572 | active_ws = focus->sway_container->pending.workspace; |
573 | } | 573 | } |
574 | 574 | ||
575 | if (!no_auto_back_and_forth && config->auto_back_and_forth && active_ws | 575 | if (config->auto_back_and_forth && active_ws && |
576 | && active_ws == workspace && seat->prev_workspace_name) { | 576 | active_ws == workspace && seat->prev_workspace_name) { |
577 | struct sway_workspace *new_ws = | 577 | struct sway_workspace *new_ws = |
578 | workspace_by_name(seat->prev_workspace_name); | 578 | workspace_by_name(seat->prev_workspace_name); |
579 | workspace = new_ws ? | 579 | workspace = new_ws ? new_ws |
580 | new_ws : | 580 | : workspace_create(NULL, seat->prev_workspace_name); |
581 | workspace_create(NULL, seat->prev_workspace_name); | ||
582 | } | 581 | } |
582 | return workspace; | ||
583 | } | ||
584 | |||
585 | bool workspace_switch(struct sway_workspace *workspace) { | ||
586 | struct sway_seat *seat = input_manager_current_seat(); | ||
583 | 587 | ||
584 | sway_log(SWAY_DEBUG, "Switching to workspace %p:%s", | 588 | sway_log(SWAY_DEBUG, "Switching to workspace %p:%s", |
585 | workspace, workspace->name); | 589 | workspace, workspace->name); |