From fd263041a00deb648c2e27daac942e86621b2855 Mon Sep 17 00:00:00 2001 From: choc Date: Wed, 10 Jan 2024 22:27:04 +0800 Subject: check if monitor is null before setting gamma fixes segfault on monitor disconnect when using wlsunset --- dwl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dwl.c b/dwl.c index 632dabf..a20c607 100644 --- a/dwl.c +++ b/dwl.c @@ -2076,6 +2076,8 @@ setgamma(struct wl_listener *listener, void *data) { struct wlr_gamma_control_manager_v1_set_gamma_event *event = data; Monitor *m = event->output->data; + if (!m) + return; m->gamma_lut_changed = 1; wlr_output_schedule_frame(m->wlr_output); } -- cgit v1.2.3