summaryrefslogtreecommitdiffstats
path: root/sway/focus.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-12-01 18:09:37 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-12-01 18:09:37 -0500
commit9b9d968cbfb04c190f86790376ea9be5f391ac49 (patch)
tree8c0d4c5651cdc37963993113a01b84f67be88894 /sway/focus.c
parentRevert "Fix bug with for_window [...] move scratchpad" (diff)
downloadsway-9b9d968cbfb04c190f86790376ea9be5f391ac49.tar.gz
sway-9b9d968cbfb04c190f86790376ea9be5f391ac49.tar.zst
sway-9b9d968cbfb04c190f86790376ea9be5f391ac49.zip
Fix for_window [...] move scratchpad correctly
Diffstat (limited to 'sway/focus.c')
-rw-r--r--sway/focus.c3
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;
15static void update_focus(swayc_t *c) { 15static 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
89bool set_focused_container(swayc_t *c) { 90bool 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);