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. --- include/wlr/backend.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/wlr/backend.h b/include/wlr/backend.h index 86decad4..5cafad66 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -34,8 +34,12 @@ struct wlr_backend { * Automatically initializes the most suitable backend given the environment. * Will always return a multi-backend. The backend is created but not started. * Returns NULL on failure. + * + * If session_ptr is not NULL, it's populated with the session which has been + * created with the backend, if any. */ -struct wlr_backend *wlr_backend_autocreate(struct wl_display *display); +struct wlr_backend *wlr_backend_autocreate(struct wl_display *display, + struct wlr_session **session_ptr); /** * Start the backend. This may signal new_input or new_output immediately, but * may also wait until the display's event loop begins. Returns false on -- cgit v1.2.3