From d5c71231e5d17db9f33284f6c4f16aeb2e3ec2a6 Mon Sep 17 00:00:00 2001 From: Ragnar Groot Koerkamp Date: Fri, 18 Jun 2021 13:13:21 +0200 Subject: Only call workspace_auto_back_and_forth when needed Instead of disabling it for some workspace subcommands, this explicitly calls it only in the 2 places it's actually needed: for switching to a named or numbered workspace. --- sway/tree/workspace.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sway/tree/workspace.c') diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 2dbd6346..7e98dc92 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -572,12 +572,13 @@ struct sway_workspace *workspace_auto_back_and_forth( active_ws = focus->sway_container->pending.workspace; } - if (config->auto_back_and_forth && active_ws && - active_ws == workspace && seat->prev_workspace_name) { + if (config->auto_back_and_forth && active_ws && active_ws == workspace && + seat->prev_workspace_name) { struct sway_workspace *new_ws = - workspace_by_name(seat->prev_workspace_name); - workspace = new_ws ? new_ws - : workspace_create(NULL, seat->prev_workspace_name); + workspace_by_name(seat->prev_workspace_name); + workspace = new_ws ? + new_ws : + workspace_create(NULL, seat->prev_workspace_name); } return workspace; } -- cgit v1.2.3-54-g00ecf