From c5a6c37275978ddc8c221ca73ae1a39254dd68f5 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 21 Oct 2018 11:26:22 +1000 Subject: Make workspace back_and_forth seat-specific * When using multiple seats, each seat has its own prev_workspace_name for the purpose of workspace back_and_forth. * Removes prev_workspace_name global variable. * Removes unused next_name_map function in tree/workspace.c. * Fixes memory leak in seat_destroy (seat was not freed). --- sway/commands/workspace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sway/commands/workspace.c') diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index da597f8a..745b40c7 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -142,12 +142,13 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { strcasecmp(argv[0], "current") == 0) { ws = workspace_by_name(argv[0]); } else if (strcasecmp(argv[0], "back_and_forth") == 0) { - if (!prev_workspace_name) { + struct sway_seat *seat = config->handler_context.seat; + if (!seat->prev_workspace_name) { return cmd_results_new(CMD_INVALID, "workspace", "There is no previous workspace"); } if (!(ws = workspace_by_name(argv[0]))) { - ws = workspace_create(NULL, prev_workspace_name); + ws = workspace_create(NULL, seat->prev_workspace_name); } } else { char *name = join_args(argv, argc); -- cgit v1.2.3-54-g00ecf