aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-21 11:26:22 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-21 11:26:22 +1000
commitc5a6c37275978ddc8c221ca73ae1a39254dd68f5 (patch)
tree2255d845647357cdbe6fdfcb1c6a40210a69ddb7 /sway/commands/swap.c
parentMerge pull request #2901 from ianyfan/swaybar (diff)
downloadsway-c5a6c37275978ddc8c221ca73ae1a39254dd68f5.tar.gz
sway-c5a6c37275978ddc8c221ca73ae1a39254dd68f5.tar.zst
sway-c5a6c37275978ddc8c221ca73ae1a39254dd68f5.zip
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,
116 output_get_active_workspace(con2->workspace->output); 116 output_get_active_workspace(con2->workspace->output);
117 117
118 char *stored_prev_name = NULL; 118 char *stored_prev_name = NULL;
119 if (prev_workspace_name) { 119 if (seat->prev_workspace_name) {
120 stored_prev_name = strdup(prev_workspace_name); 120 stored_prev_name = strdup(seat->prev_workspace_name);
121 } 121 }
122 122
123 swap_places(con1, con2); 123 swap_places(con1, con2);
@@ -132,8 +132,8 @@ static void container_swap(struct sway_container *con1,
132 swap_focus(con1, con2, seat, focus); 132 swap_focus(con1, con2, seat, focus);
133 133
134 if (stored_prev_name) { 134 if (stored_prev_name) {
135 free(prev_workspace_name); 135 free(seat->prev_workspace_name);
136 prev_workspace_name = stored_prev_name; 136 seat->prev_workspace_name = stored_prev_name;
137 } 137 }
138 138
139 if (fs1) { 139 if (fs1) {