From 8597c3c7e7c2fcdb712f49e06c70882541389929 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 9 Aug 2015 20:20:53 -0400 Subject: [PATCH] Implement focus parent --- sway/commands.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sway/commands.c b/sway/commands.c index 15c43ac28..725eaf15d 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -111,6 +111,11 @@ int cmd_focus(struct sway_config *config, int argc, char **argv) { move_focus(MOVE_UP); } else if (strcasecmp(argv[0], "down") == 0) { move_focus(MOVE_DOWN); + } else if (strcasecmp(argv[0], "parent") == 0) { + swayc_t *current = get_focused_container(&root_container); + current->parent->focused = NULL; + unfocus_all(current->parent); + focus_view(current->parent); } return 0; }