diff options
Diffstat (limited to 'sway/workspace.c')
-rw-r--r-- | sway/workspace.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/workspace.c b/sway/workspace.c index b8b4d66e..49a1224f 100644 --- a/sway/workspace.c +++ b/sway/workspace.c | |||
@@ -94,12 +94,12 @@ swayc_t *workspace_find_by_name(const char* name) { | |||
94 | } | 94 | } |
95 | 95 | ||
96 | void workspace_switch(swayc_t *workspace) { | 96 | void workspace_switch(swayc_t *workspace) { |
97 | swayc_t *parent = workspace->parent; | 97 | swayc_t *ws_output = workspace->parent; |
98 | while (parent->type != C_OUTPUT) { | 98 | while (ws_output->type != C_OUTPUT) { |
99 | parent = parent->parent; | 99 | ws_output = ws_output->parent; |
100 | } | 100 | } |
101 | // The current workspace of the output our target workspace is in | 101 | // The current workspace of the output our target workspace is in |
102 | swayc_t *focused_workspace = parent->focused; | 102 | swayc_t *focused_workspace = ws_output->focused; |
103 | if (workspace != focused_workspace && focused_workspace) { | 103 | if (workspace != focused_workspace && focused_workspace) { |
104 | sway_log(L_DEBUG, "workspace: changing from '%s' to '%s'", focused_workspace->name, workspace->name); | 104 | sway_log(L_DEBUG, "workspace: changing from '%s' to '%s'", focused_workspace->name, workspace->name); |
105 | uint32_t mask = 1; | 105 | uint32_t mask = 1; |
@@ -109,7 +109,7 @@ void workspace_switch(swayc_t *workspace) { | |||
109 | container_map(focused_workspace, set_mask, &mask); | 109 | container_map(focused_workspace, set_mask, &mask); |
110 | mask = 2; | 110 | mask = 2; |
111 | container_map(workspace, set_mask, &mask); | 111 | container_map(workspace, set_mask, &mask); |
112 | wlc_output_set_mask(wlc_get_focused_output(), 2); | 112 | wlc_output_set_mask(ws_output->handle, 2); |
113 | 113 | ||
114 | destroy_workspace(focused_workspace); | 114 | destroy_workspace(focused_workspace); |
115 | } | 115 | } |