diff options
Diffstat (limited to 'sway/movement.c')
-rw-r--r-- | sway/movement.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/movement.c b/sway/movement.c index 108e2588..a55d0350 100644 --- a/sway/movement.c +++ b/sway/movement.c | |||
@@ -9,6 +9,20 @@ int move_focus(enum movement_direction direction) { | |||
9 | swayc_t *current = get_focused_container(&root_container); | 9 | swayc_t *current = get_focused_container(&root_container); |
10 | swayc_t *parent = current->parent; | 10 | swayc_t *parent = current->parent; |
11 | 11 | ||
12 | if (direction == MOVE_PARENT) { | ||
13 | current = parent; | ||
14 | parent = parent->parent; | ||
15 | if (parent->type == C_ROOT) { | ||
16 | sway_log(L_DEBUG, "Focus cannot move to parent"); | ||
17 | return 1; | ||
18 | } else { | ||
19 | sway_log(L_DEBUG, "Moving focus away from %p", current); | ||
20 | unfocus_all(parent); | ||
21 | focus_view(parent); | ||
22 | return 0; | ||
23 | } | ||
24 | } | ||
25 | |||
12 | while (true) { | 26 | while (true) { |
13 | sway_log(L_DEBUG, "Moving focus away from %p", current); | 27 | sway_log(L_DEBUG, "Moving focus away from %p", current); |
14 | 28 | ||