aboutsummaryrefslogtreecommitdiff
path: root/sway/workspace.c
diff options
context:
space:
mode:
authorLuminarys <kizunanohikari@gmail.com>2015-08-15 15:15:25 -0500
committerLuminarys <kizunanohikari@gmail.com>2015-08-15 15:15:25 -0500
commit469579835b4ffdbca651a6eee103f6df56eec1ef (patch)
tree2fdb946f3b3932edd1d7a2a47b93488e0dedc1a5 /sway/workspace.c
parent7f9ed880b0b102a1c9765d8b32e025ca778a57d5 (diff)
Fixed output focusing for workspace switch
Diffstat (limited to 'sway/workspace.c')
-rw-r--r--sway/workspace.c10
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) {
}
void workspace_switch(swayc_t *workspace) {
- swayc_t *parent = workspace->parent;
- while (parent->type != C_OUTPUT) {
- parent = parent->parent;
+ swayc_t *ws_output = workspace->parent;
+ while (ws_output->type != C_OUTPUT) {
+ ws_output = ws_output->parent;
}
// The current workspace of the output our target workspace is in
- swayc_t *focused_workspace = parent->focused;
+ swayc_t *focused_workspace = ws_output->focused;
if (workspace != focused_workspace && focused_workspace) {
sway_log(L_DEBUG, "workspace: changing from '%s' to '%s'", focused_workspace->name, workspace->name);
uint32_t mask = 1;
@@ -109,7 +109,7 @@ void workspace_switch(swayc_t *workspace) {
container_map(focused_workspace, set_mask, &mask);
mask = 2;
container_map(workspace, set_mask, &mask);
- wlc_output_set_mask(wlc_get_focused_output(), 2);
+ wlc_output_set_mask(ws_output->handle, 2);
destroy_workspace(focused_workspace);
}