diff options
author | Drew DeVault <[email protected]> | 2015-08-18 08:20:59 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-08-18 08:30:21 -0400 |
commit | a64b10df83f84e7ee8933ac139f10c59bfd76466 (patch) | |
tree | 4b0f517cb27be923f8f41508e8c778d660bd6fcf /sway/workspace.c | |
parent | 868cb3ca71713014cc613b49f8521c01e60f366e (diff) |
Fix switching between focused outputs
Diffstat (limited to 'sway/workspace.c')
-rw-r--r-- | sway/workspace.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/workspace.c b/sway/workspace.c index bc0fa2c8..ed545804 100644 --- a/sway/workspace.c +++ b/sway/workspace.c @@ -174,6 +174,17 @@ void workspace_prev() { } void workspace_switch(swayc_t *workspace) { + if (!workspace) { + return; + } + sway_log(L_DEBUG, "Switching to workspace %p:%s", workspace, workspace->name); + + // Remove focus from current view + swayc_t *current = get_focused_view(&root_container); + if (current && current->type == C_VIEW) { + wlc_view_set_state(current->handle, WLC_BIT_ACTIVATED, false); + } + set_focused_container(workspace); active_workspace = workspace; } |