aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-10-21 11:26:22 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-10-21 11:26:22 +1000
commitc5a6c37275978ddc8c221ca73ae1a39254dd68f5 (patch)
tree2255d845647357cdbe6fdfcb1c6a40210a69ddb7 /sway/commands/swap.c
parent3f02218b54645a68a7496eb15b7bb16d26b75ae2 (diff)
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).
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r--sway/commands/swap.c8
1 files changed, 4 insertions, 4 deletions
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) {