diff options
Diffstat (limited to 'sway/workspace.c')
-rw-r--r-- | sway/workspace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/workspace.c b/sway/workspace.c index 252526ce..0f36e35a 100644 --- a/sway/workspace.c +++ b/sway/workspace.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "focus.h" | 13 | #include "focus.h" |
14 | #include "util.h" | 14 | #include "util.h" |
15 | 15 | ||
16 | char *prev_workspace_name; | ||
17 | |||
16 | char *workspace_next_name(void) { | 18 | char *workspace_next_name(void) { |
17 | sway_log(L_DEBUG, "Workspace: Generating new name"); | 19 | sway_log(L_DEBUG, "Workspace: Generating new name"); |
18 | int i; | 20 | int i; |
@@ -180,6 +182,11 @@ void workspace_switch(swayc_t *workspace) { | |||
180 | if (!workspace) { | 182 | if (!workspace) { |
181 | return; | 183 | return; |
182 | } | 184 | } |
185 | if (!prev_workspace_name || strcmp(prev_workspace_name, swayc_active_workspace()->name) != 0) { | ||
186 | prev_workspace_name = malloc(strlen(swayc_active_workspace()->name) + 1); | ||
187 | strcpy(prev_workspace_name, swayc_active_workspace()->name); | ||
188 | } | ||
189 | |||
183 | sway_log(L_DEBUG, "Switching to workspace %p:%s", workspace, workspace->name); | 190 | sway_log(L_DEBUG, "Switching to workspace %p:%s", workspace, workspace->name); |
184 | set_focused_container(get_focused_view(workspace)); | 191 | set_focused_container(get_focused_view(workspace)); |
185 | arrange_windows(workspace, -1, -1); | 192 | arrange_windows(workspace, -1, -1); |