mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
Merge pull request #832 from thejan2009/bug/workspace-back-and-forth
Fix 'workspace back_and_forth' and workspace_auto_back_and_forth clash
This commit is contained in:
commit
f773eb96a8
@ -2563,11 +2563,14 @@ static struct cmd_results *cmd_workspace(int argc, char **argv) {
|
|||||||
} else if (strcasecmp(argv[0], "prev_on_output") == 0) {
|
} else if (strcasecmp(argv[0], "prev_on_output") == 0) {
|
||||||
ws = workspace_output_prev();
|
ws = workspace_output_prev();
|
||||||
} else if (strcasecmp(argv[0], "back_and_forth") == 0) {
|
} else if (strcasecmp(argv[0], "back_and_forth") == 0) {
|
||||||
if (prev_workspace_name) {
|
// if auto_back_and_forth is enabled, workspace_switch will swap
|
||||||
if (!(ws = workspace_by_name(prev_workspace_name))) {
|
// the workspaces. If we created prev_workspace here, workspace_switch
|
||||||
|
// would put us back on original workspace.
|
||||||
|
if (config->auto_back_and_forth) {
|
||||||
|
ws = swayc_active_workspace();
|
||||||
|
} else if (prev_workspace_name && !(ws = workspace_by_name(prev_workspace_name))) {
|
||||||
ws = workspace_create(prev_workspace_name);
|
ws = workspace_create(prev_workspace_name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!(ws = workspace_by_name(argv[0]))) {
|
if (!(ws = workspace_by_name(argv[0]))) {
|
||||||
ws = workspace_create(argv[0]);
|
ws = workspace_create(argv[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user