aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-09 22:53:00 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-09 22:53:00 -0400
commitb49cfa0c16b442b048213296bc3f75c4e5393a6e (patch)
treee24085b251f36ef33ded7717f3d42c379c2fd13a /sway
parentfed757ebb2188661b6e2e93ba2432cc67531b62e (diff)
downloadsway-b49cfa0c16b442b048213296bc3f75c4e5393a6e.tar.xz
Fix bug with focus parent
Thanks anon
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c
index cee8bf84..9ce1d83e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -113,9 +113,11 @@ int cmd_focus(struct sway_config *config, int argc, char **argv) {
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);
+ if (current && current->parent) {
+ current->parent->focused = NULL;
+ unfocus_all(current->parent);
+ focus_view(current->parent);
+ }
}
return 0;
}