aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/output.c')
-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;