From 3080f1b9ce069c0697291bd3ef23c38ae610fa8c Mon Sep 17 00:00:00 2001 From: Ragnar Groot Koerkamp Date: Fri, 18 Jun 2021 12:19:18 +0200 Subject: Move auto_back_and_forth logic out of workspace_switch This extracts the code to a separate workspace_auto_back_and_forth function. It also removes the bool argument by adding an extra if statement at the call site, and repurposes the no_auto_back_and_forth variable to auto_back_and_forth for simpler understanding. --- include/sway/tree/workspace.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index fdd92f64..65ba247f 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -60,8 +60,10 @@ void workspace_consider_destroy(struct sway_workspace *ws); char *workspace_next_name(const char *output_name); -bool workspace_switch(struct sway_workspace *workspace, - bool no_auto_back_and_forth); +struct sway_workspace *workspace_auto_back_and_forth( + struct sway_workspace *workspace); + +bool workspace_switch(struct sway_workspace *workspace); struct sway_workspace *workspace_by_number(const char* name); -- cgit v1.2.3