cage: create backend with wl_event_loop and output layout with wl_display

This commit is contained in:
Simon Ser 2024-02-16 16:19:03 +01:00
parent 47ea6a5d68
commit b9add8b729

5
cage.c
View file

@ -294,7 +294,7 @@ main(int argc, char *argv[])
struct wl_event_source *sigterm_source = struct wl_event_source *sigterm_source =
wl_event_loop_add_signal(event_loop, SIGTERM, handle_signal, server.wl_display); wl_event_loop_add_signal(event_loop, SIGTERM, handle_signal, server.wl_display);
server.backend = wlr_backend_autocreate(server.wl_display, &server.session); server.backend = wlr_backend_autocreate(event_loop, &server.session);
if (!server.backend) { if (!server.backend) {
wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); wlr_log(WLR_ERROR, "Unable to create the wlroots backend");
ret = 1; ret = 1;
@ -325,7 +325,7 @@ main(int argc, char *argv[])
wl_list_init(&server.views); wl_list_init(&server.views);
wl_list_init(&server.outputs); wl_list_init(&server.outputs);
server.output_layout = wlr_output_layout_create(); server.output_layout = wlr_output_layout_create(server.wl_display);
if (!server.output_layout) { if (!server.output_layout) {
wlr_log(WLR_ERROR, "Unable to create output layout"); wlr_log(WLR_ERROR, "Unable to create output layout");
ret = 1; ret = 1;
@ -596,6 +596,5 @@ end:
/* This function is not null-safe, but we only ever get here /* This function is not null-safe, but we only ever get here
with a proper wl_display. */ with a proper wl_display. */
wl_display_destroy(server.wl_display); wl_display_destroy(server.wl_display);
wlr_output_layout_destroy(server.output_layout);
return ret; return ret;
} }