summaryrefslogtreecommitdiffstats
path: root/sway/focus.c
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-12-18 03:33:42 +0100
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-12-18 13:23:49 +0100
commit18a7afa1b34bb1c37df1547ff6e1dc0c4e2a88b8 (patch)
tree0a829a9dfcd842eabacca2c9f0d9e51a740f6e53 /sway/focus.c
parentMerge pull request #353 from mikkeloscar/swaybar-close-statuscmd (diff)
downloadsway-18a7afa1b34bb1c37df1547ff6e1dc0c4e2a88b8.tar.gz
sway-18a7afa1b34bb1c37df1547ff6e1dc0c4e2a88b8.tar.zst
sway-18a7afa1b34bb1c37df1547ff6e1dc0c4e2a88b8.zip
focus: Fix moving last workspace.
If there's only one workspace on an output and it's moved to a different output then active workspace will be NULL.
Diffstat (limited to 'sway/focus.c')
-rw-r--r--sway/focus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/focus.c b/sway/focus.c
index c60f410c..c1170ca4 100644
--- a/sway/focus.c
+++ b/sway/focus.c
@@ -96,7 +96,10 @@ bool set_focused_container(swayc_t *c) {
96 return false; 96 return false;
97 } 97 }
98 swayc_t *active_ws = swayc_active_workspace(); 98 swayc_t *active_ws = swayc_active_workspace();
99 int active_ws_child_count = active_ws->children->length + active_ws->floating->length; 99 int active_ws_child_count = 0;
100 if (active_ws) {
101 active_ws_child_count = active_ws->children->length + active_ws->floating->length;
102 }
100 103
101 swayc_log(L_DEBUG, c, "Setting focus to %p:%ld", c, c->handle); 104 swayc_log(L_DEBUG, c, "Setting focus to %p:%ld", c, c->handle);
102 105