From 4ef6948efc7c5155bb63f041d2c10039ccb121bf Mon Sep 17 00:00:00 2001 From: Mars-Wave <57585293+Mars-Wave@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:19:29 +0200 Subject: [PATCH] Clear head output when the output is destroyed --- src/outputs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/outputs.c b/src/outputs.c index 024a686..7886d72 100644 --- a/src/outputs.c +++ b/src/outputs.c @@ -310,6 +310,12 @@ static void wd_output_destroy(struct wd_output *output) { if (output->state->layer_shell != NULL) { wd_destroy_overlay(output); } + struct wd_head *head; + wl_list_for_each(head, &output->state->heads, link) { + if (head->output == output) { + head->output = NULL; + } + } zxdg_output_v1_destroy(output->xdg_output); free(output->name); free(output);