diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-01 18:00:46 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-01 18:00:46 -0500 |
commit | 0796b0c475bb46095d14a5291d62dd8e7d098262 (patch) | |
tree | 44e80bbf2710f8a7cccbe1103a9fdd811dfa87af /sway/focus.c | |
parent | 98ff23b49739b29f5b8d2d3b1dbe2e7fe740d79a (diff) |
Fix bug with for_window [...] move scratchpad
Diffstat (limited to 'sway/focus.c')
-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..0703ffb6 100644 --- a/sway/focus.c +++ b/sway/focus.c @@ -15,6 +15,7 @@ bool locked_view_focus = false; static void update_focus(swayc_t *c) { // Handle if focus switches swayc_t *parent = c->parent; + if (!parent) return; if (parent->focused != c) { // Get previous focus swayc_t *prev = parent->focused; @@ -87,7 +88,7 @@ swayc_t *get_focused_container(swayc_t *parent) { } bool set_focused_container(swayc_t *c) { - if (locked_container_focus || !c) { + if (locked_container_focus || !c || !c->visible || !c->parent) { return false; } swayc_log(L_DEBUG, c, "Setting focus to %p:%ld", c, c->handle); |