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 | |
parent | Fix busted install of /etc/sway/config (diff) | |
download | sway-0796b0c475bb46095d14a5291d62dd8e7d098262.tar.gz sway-0796b0c475bb46095d14a5291d62dd8e7d098262.tar.zst sway-0796b0c475bb46095d14a5291d62dd8e7d098262.zip |
Fix bug with for_window [...] move scratchpad
-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; | |||
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->visible || !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); |