mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
cleaned up leaky prev_workspace_name
This commit is contained in:
parent
9eb5ba4961
commit
972748e674
2 changed files with 15 additions and 13 deletions
|
|
@ -822,11 +822,8 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) {
|
|||
}
|
||||
if (strcasecmp(argv[0], "back_and_forth") == 0) {
|
||||
if (prev_workspace_name) {
|
||||
if (workspace_by_name(prev_workspace_name)) {
|
||||
workspace_switch(workspace_by_name(prev_workspace_name));
|
||||
} else {
|
||||
workspace_switch(workspace_create(prev_workspace_name));
|
||||
}
|
||||
swayc_t *ws = workspace_by_name(prev_workspace_name);
|
||||
workspace_switch(ws ? ws : workspace_create(prev_workspace_name));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue