summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2016-07-27 22:06:16 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2016-07-27 22:06:16 -0400
commit8a03f138bf2d14a3e5d864df22563e72a19b85d1 (patch)
treeab2c6db115963d22715f454501ecee5c33a997fb
parentMerge pull request #789 from acrisci/bug/focus-parent-above-workspace (diff)
downloadsway-8a03f138bf2d14a3e5d864df22563e72a19b85d1.tar.gz
sway-8a03f138bf2d14a3e5d864df22563e72a19b85d1.tar.zst
sway-8a03f138bf2d14a3e5d864df22563e72a19b85d1.zip
bugfix: set focus to workspace of an output
In `move_focus()`, when given an output, set the focus to the workspace of that output instead of the output itself. This fixes a bug that did not allow users to switch between outputs introduced in afc6ad6. It also fixes other issues before that commit when a workspace with children was selected and the user tried to switch focus in the direction of another output.
-rw-r--r--sway/focus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/focus.c b/sway/focus.c
index d2a1e0d6..c7737a1d 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -67,9 +67,11 @@ bool move_focus(enum movement_direction direction) {
67 swayc_t *new_view = get_swayc_in_direction(old_view, direction); 67 swayc_t *new_view = get_swayc_in_direction(old_view, direction);
68 if (!new_view) { 68 if (!new_view) {
69 return false; 69 return false;
70 } else if (new_view->type == C_ROOT || new_view->type == C_OUTPUT) { 70 } else if (new_view->type == C_ROOT) {
71 sway_log(L_DEBUG, "Not setting focus above the workspace level"); 71 sway_log(L_DEBUG, "Not setting focus above the workspace level");
72 return false; 72 return false;
73 } else if (new_view->type == C_OUTPUT) {
74 return set_focused_container(swayc_active_workspace_for(new_view));
73 } else if (direction == MOVE_PARENT) { 75 } else if (direction == MOVE_PARENT) {
74 return set_focused_container(new_view); 76 return set_focused_container(new_view);
75 } else if (config->mouse_warping) { 77 } else if (config->mouse_warping) {