From 41b7acbab78597e2eb0724e415ed94b910d113c1 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 3 Nov 2022 18:25:05 +0100 Subject: backend: return wlr_session in wlr_backend_autocreate() call Up until now, wlr_backend_autocreate() created the wlr_session and then stuffed it into struct wlr_multi_backend so that compositors can grab it later. This is an abuse of wlr_multi_backend and the wlr_backend API: wlr_backend_get_session() and wlr_multi_backend.session only exist to accomodate the needs of wlr_backend_autocreate(). What's more, the DRM and libinput backends don't implement wlr_backend_impl.get_session. Instead, return the struct wlr_session to the compositor in the wlr_backend_autocreate() call. wlr_backend_get_session() will be removed in the next commit. --- examples/fullscreen-shell.c | 2 +- examples/multi-pointer.c | 2 +- examples/output-layout.c | 2 +- examples/pointer.c | 2 +- examples/quads.c | 2 +- examples/rotation.c | 2 +- examples/scene-graph.c | 2 +- examples/simple.c | 2 +- examples/tablet.c | 2 +- examples/touch.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c index bc4bb7a8..cba5a4cb 100644 --- a/examples/fullscreen-shell.c +++ b/examples/fullscreen-shell.c @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) { struct fullscreen_server server = {0}; server.wl_display = wl_display_create(); - server.backend = wlr_backend_autocreate(server.wl_display); + server.backend = wlr_backend_autocreate(server.wl_display, NULL); server.renderer = wlr_renderer_autocreate(server.backend); wlr_renderer_init_wl_display(server.renderer, server.wl_display); server.allocator = wlr_allocator_autocreate(server.backend, diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c index 26311319..920ee0fc 100644 --- a/examples/multi-pointer.c +++ b/examples/multi-pointer.c @@ -272,7 +272,7 @@ int main(int argc, char *argv[]) { .clear_color = { 0.25f, 0.25f, 0.25f, 1 }, .display = display, }; - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/output-layout.c b/examples/output-layout.c index 97939953..8a40e83f 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -268,7 +268,7 @@ int main(int argc, char *argv[]) { state.layout = wlr_output_layout_create(); clock_gettime(CLOCK_MONOTONIC, &state.ts_last); - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/pointer.c b/examples/pointer.c index 6eb328ac..db85b13a 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -333,7 +333,7 @@ int main(int argc, char *argv[]) { .display = display }; - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/quads.c b/examples/quads.c index a9c7a14b..2b6f5e9b 100644 --- a/examples/quads.c +++ b/examples/quads.c @@ -189,7 +189,7 @@ int main(int argc, char *argv[]) { }; wl_list_init(&state.outputs); - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/rotation.c b/examples/rotation.c index 087fa8d1..33a4ac86 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -239,7 +239,7 @@ int main(int argc, char *argv[]) { }; wl_list_init(&state.outputs); - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/scene-graph.c b/examples/scene-graph.c index ba5d2d75..5821c906 100644 --- a/examples/scene-graph.c +++ b/examples/scene-graph.c @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) { struct server server = {0}; server.surface_offset = 0; server.display = wl_display_create(); - server.backend = wlr_backend_autocreate(server.display); + server.backend = wlr_backend_autocreate(server.display, NULL); server.scene = wlr_scene_create(); server.renderer = wlr_renderer_autocreate(server.backend); diff --git a/examples/simple.c b/examples/simple.c index 5a41d19e..68308c7f 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -172,7 +172,7 @@ int main(void) { .last_frame = { 0 }, .display = display }; - struct wlr_backend *backend = wlr_backend_autocreate(display); + struct wlr_backend *backend = wlr_backend_autocreate(display, NULL); if (!backend) { exit(1); } diff --git a/examples/tablet.c b/examples/tablet.c index 1fb0233b..3e18636a 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -355,7 +355,7 @@ int main(int argc, char *argv[]) { }; wl_list_init(&state.tablet_pads); wl_list_init(&state.tablet_tools); - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } diff --git a/examples/touch.c b/examples/touch.c index d33e148a..7c340e3c 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) { wl_list_init(&state.touch_points); wl_list_init(&state.touch); - struct wlr_backend *wlr = wlr_backend_autocreate(display); + struct wlr_backend *wlr = wlr_backend_autocreate(display, NULL); if (!wlr) { exit(1); } -- cgit v1.2.3