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/swap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sway/commands/swap.c') diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 6062724d..afe11a47 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c @@ -116,8 +116,8 @@ static void container_swap(struct sway_container *con1, output_get_active_workspace(con2->workspace->output); char *stored_prev_name = NULL; - if (prev_workspace_name) { - stored_prev_name = strdup(prev_workspace_name); + if (seat->prev_workspace_name) { + stored_prev_name = strdup(seat->prev_workspace_name); } swap_places(con1, con2); @@ -132,8 +132,8 @@ static void container_swap(struct sway_container *con1, swap_focus(con1, con2, seat, focus); if (stored_prev_name) { - free(prev_workspace_name); - prev_workspace_name = stored_prev_name; + free(seat->prev_workspace_name); + seat->prev_workspace_name = stored_prev_name; } if (fs1) { -- cgit v1.2.3