aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-02-21 09:14:19 -0500
committerGitHub <noreply@github.com>2019-02-21 09:14:19 -0500
commit79c133182d85342748b284e20e1e634821ce419c (patch)
tree690007114db3d7e4bfcfeb0c1637d06c82993c08 /sway
parent546b976baa9989676c2fb2aff8c36f42b3d19810 (diff)
parent03dfdb1edbfc445fe30b6456827ae93ef6c18426 (diff)
downloadsway-79c133182d85342748b284e20e1e634821ce419c.tar.xz
Merge pull request #3743 from RedSoxFan/fix-output-get-active-workspace
output_get_active_workspace: check workspaces length
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index c5461ee6..61beb7af 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -320,6 +320,9 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) {
struct sway_seat *seat = input_manager_current_seat();
struct sway_node *focus = seat_get_active_tiling_child(seat, &output->node);
if (!focus) {
+ if (!output->workspaces->length) {
+ return NULL;
+ }
return output->workspaces->items[0];
}
return focus->sway_workspace;