summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@proton.me>2023-11-30 22:17:30 -0600
committerLeonardo Hernández Hernández <leohdz172@proton.me>2023-11-30 22:38:52 -0600
commit901d2e2d9d54ab6c6a66d0877402bab04a60093e (patch)
treedf2a06169cd2933791db3910a1f1d08ecf8ba904
parent00e867d5365a7d98b1094386f8a0b88839eb9d86 (diff)
check failure of wlr_output_init_render
-rw-r--r--dwl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dwl.c b/dwl.c
index 6d74a3f..1eee591 100644
--- a/dwl.c
+++ b/dwl.c
@@ -859,10 +859,13 @@ createmon(struct wl_listener *listener, void *data)
const MonitorRule *r;
size_t i;
struct wlr_output_state state;
- Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m));
- m->wlr_output = wlr_output;
+ Monitor *m;
- wlr_output_init_render(wlr_output, alloc, drw);
+ if (!wlr_output_init_render(wlr_output, alloc, drw))
+ return;
+
+ m = wlr_output->data = ecalloc(1, sizeof(*m));
+ m->wlr_output = wlr_output;
for (i = 0; i < LENGTH(m->layers); i++)
wl_list_init(&m->layers[i]);