diff options
-rw-r--r-- | sway/focus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/focus.c b/sway/focus.c index 7af858a1..9f070866 100644 --- a/sway/focus.c +++ b/sway/focus.c | |||
@@ -15,6 +15,7 @@ bool locked_view_focus = false; | |||
15 | static void update_focus(swayc_t *c) { | 15 | static void update_focus(swayc_t *c) { |
16 | // Handle if focus switches | 16 | // Handle if focus switches |
17 | swayc_t *parent = c->parent; | 17 | swayc_t *parent = c->parent; |
18 | if (!parent) return; | ||
18 | if (parent->focused != c) { | 19 | if (parent->focused != c) { |
19 | // Get previous focus | 20 | // Get previous focus |
20 | swayc_t *prev = parent->focused; | 21 | swayc_t *prev = parent->focused; |
@@ -87,7 +88,7 @@ swayc_t *get_focused_container(swayc_t *parent) { | |||
87 | } | 88 | } |
88 | 89 | ||
89 | bool set_focused_container(swayc_t *c) { | 90 | bool set_focused_container(swayc_t *c) { |
90 | if (locked_container_focus || !c) { | 91 | if (locked_container_focus || !c || !c->parent) { |
91 | return false; | 92 | return false; |
92 | } | 93 | } |
93 | swayc_log(L_DEBUG, c, "Setting focus to %p:%ld", c, c->handle); | 94 | swayc_log(L_DEBUG, c, "Setting focus to %p:%ld", c, c->handle); |