mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 17:54:14 +00:00
destroy output and return if first commit fails
rather than leave the monitor half-initialized Bug: https://codeberg.org/dwl/dwl/issues/527
This commit is contained in:
parent
a5e068b20a
commit
06eb09384b
10
dwl.c
10
dwl.c
@ -899,15 +899,17 @@ createmon(struct wl_listener *listener, void *data)
|
||||
* the user configure it. */
|
||||
wlr_output_set_mode(wlr_output, wlr_output_preferred_mode(wlr_output));
|
||||
|
||||
wlr_output_enable(wlr_output, 1);
|
||||
if (!wlr_output_commit(wlr_output)) {
|
||||
wlr_output_destroy(wlr_output);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set up event listeners */
|
||||
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
|
||||
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
|
||||
LISTEN(&wlr_output->events.request_state, &m->request_state, requestmonstate);
|
||||
|
||||
wlr_output_enable(wlr_output, 1);
|
||||
if (!wlr_output_commit(wlr_output))
|
||||
return;
|
||||
|
||||
wl_list_insert(&mons, &m->link);
|
||||
printstatus();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user