mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -04:00
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).
This commit is contained in:
parent
3f02218b54
commit
c5a6c37275
8 changed files with 32 additions and 33 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue