diff options
Diffstat (limited to 'sway/movement.c')
-rw-r--r-- | sway/movement.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/movement.c b/sway/movement.c index 166e6508..de987679 100644 --- a/sway/movement.c +++ b/sway/movement.c | |||
@@ -10,14 +10,12 @@ bool move_focus(enum movement_direction direction) { | |||
10 | swayc_t *parent = current->parent; | 10 | swayc_t *parent = current->parent; |
11 | 11 | ||
12 | if (direction == MOVE_PARENT) { | 12 | if (direction == MOVE_PARENT) { |
13 | current = parent; | 13 | if (parent->type == C_OUTPUT) { |
14 | parent = parent->parent; | ||
15 | if (parent->type == C_ROOT) { | ||
16 | sway_log(L_DEBUG, "Focus cannot move to parent"); | 14 | sway_log(L_DEBUG, "Focus cannot move to parent"); |
17 | return false; | 15 | return false; |
18 | } else { | 16 | } else { |
19 | sway_log(L_DEBUG, "Moving focus away from %p", current); | 17 | sway_log(L_DEBUG, "Moving focus away from %p to %p", current, parent); |
20 | unfocus_all(parent); | 18 | unfocus_all(parent->parent); |
21 | focus_view(parent); | 19 | focus_view(parent); |
22 | return true; | 20 | return true; |
23 | } | 21 | } |