diff options
author | Taiyu <[email protected]> | 2015-08-10 00:05:44 -0700 |
---|---|---|
committer | Taiyu <[email protected]> | 2015-08-10 00:05:44 -0700 |
commit | b43161fd45c794448d17e705413949dbb62727db (patch) | |
tree | 7523ded3c7d8ec6a6715437caf17f89d1ba0fdcc /sway/movement.c | |
parent | 6f0a1cdcd1c4b77aab062670e5522ebc1e956208 (diff) |
fixed focus_parent, moved into move_focus() function
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..4503a716 100644 --- a/sway/movement.c +++ b/sway/movement.c @@ -9,6 +9,20 @@ int move_focus(enum movement_direction direction) { swayc_t *current = get_focused_container(&root_container); swayc_t *parent = current->parent; + if(direction == MOVE_PARENT) { + current = parent; + parent = parent->parent; + if(parent->type == C_ROOT) { + sway_log(L_DEBUG, "Focus cannot move to parent"); + return 1; + } else { + sway_log(L_DEBUG, "Moving focus away from %p", current); + unfocus_all(parent); + focus_view (parent); + return 0; + } + } + while (true) { sway_log(L_DEBUG, "Moving focus away from %p", current); |