aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorDonnie West <me@donniewest.com>2018-08-15 21:49:40 -0500
committerDonnie West <me@donniewest.com>2018-08-16 18:52:40 -0500
commita9433cbded6249936047e580e98e113432925e49 (patch)
tree83f8edec1482673a1ac26b02ea4bfcde014fed99 /sway/tree
parent98ed05225e06618533fa0439fdc83463cb9f1d2e (diff)
downloadsway-a9433cbded6249936047e580e98e113432925e49.tar.xz
When the workspace is focused, return it instead of checking parent
Diffstat (limited to 'sway/tree')
-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) {
struct sway_container *current_workspace = NULL, *current_output = NULL;
struct sway_container *focus = seat_get_focus(seat);
if (focus) {
- current_workspace = container_parent(focus, C_WORKSPACE);
+ current_workspace = focus->type == C_WORKSPACE ?
+ focus : container_parent(focus, C_WORKSPACE);
current_output = container_parent(focus, C_OUTPUT);
}