summaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index cd2a7a04..e7383de0 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -258,7 +258,8 @@ struct sway_container *workspace_by_name(const char *name) {
258 struct sway_container *current_workspace = NULL, *current_output = NULL; 258 struct sway_container *current_workspace = NULL, *current_output = NULL;
259 struct sway_container *focus = seat_get_focus(seat); 259 struct sway_container *focus = seat_get_focus(seat);
260 if (focus) { 260 if (focus) {
261 current_workspace = container_parent(focus, C_WORKSPACE); 261 current_workspace = focus->type == C_WORKSPACE ?
262 focus : container_parent(focus, C_WORKSPACE);
262 current_output = container_parent(focus, C_OUTPUT); 263 current_output = container_parent(focus, C_OUTPUT);
263 } 264 }
264 265