aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-14 11:43:39 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-03-14 10:03:45 -0600
commitd8f74e4706104ac751706d5071838f97e3956a5e (patch)
treee502fbd08807d6a32b782fe48345d2cd39be56a6 /sway/tree/workspace.c
parentswaybar: fix loading of malformed icon theme (diff)
downloadsway-d8f74e4706104ac751706d5071838f97e3956a5e.tar.gz
sway-d8f74e4706104ac751706d5071838f97e3956a5e.tar.zst
sway-d8f74e4706104ac751706d5071838f97e3956a5e.zip
Set prev_workspace_name based off of focus
This moves setting `seat->prev_workspace_name` from `workspace_switch` to `set_workspace`. `workspace_switch` is only called when using a `workspace` command to change the workspace so any workspace change based on criteria was not altering `seat->prev_workspace_name`. By moving it to `set_workspace`, which is called by `seat_set_focus`, it will change any time focus changes to a node on a different workspace
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 5e28197b..68a55e03 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -481,18 +481,6 @@ bool workspace_switch(struct sway_workspace *workspace,
481 workspace_create(NULL, seat->prev_workspace_name); 481 workspace_create(NULL, seat->prev_workspace_name);
482 } 482 }
483 483
484 if (active_ws && (!seat->prev_workspace_name ||
485 (strcmp(seat->prev_workspace_name, active_ws->name)
486 && active_ws != workspace))) {
487 free(seat->prev_workspace_name);
488 seat->prev_workspace_name = malloc(strlen(active_ws->name) + 1);
489 if (!seat->prev_workspace_name) {
490 sway_log(SWAY_ERROR, "Unable to allocate previous workspace name");
491 return false;
492 }
493 strcpy(seat->prev_workspace_name, active_ws->name);
494 }
495
496 sway_log(SWAY_DEBUG, "Switching to workspace %p:%s", 484 sway_log(SWAY_DEBUG, "Switching to workspace %p:%s",
497 workspace, workspace->name); 485 workspace, workspace->name);
498 struct sway_node *next = seat_get_focus_inactive(seat, &workspace->node); 486 struct sway_node *next = seat_get_focus_inactive(seat, &workspace->node);