From 63792b38e46ae1741a6492d3c0183cb9566e4c9f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 11 Aug 2023 19:28:07 +0200 Subject: backend/session: take wl_event_loop instead of wl_display wl_display holds a lot more than wlr_session needs: wlr_session only needs to wait for a FD to become readable, but wl_display provides full access to the Wayland client and protocol objects. Switch to wl_event_loop to better reflect the above. --- backend/backend.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'backend/backend.c') diff --git a/backend/backend.c b/backend/backend.c index e5b8db14..1e57e832 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -73,7 +73,8 @@ void wlr_backend_destroy(struct wlr_backend *backend) { static struct wlr_session *session_create_and_wait(struct wl_display *disp) { #if WLR_HAS_SESSION - struct wlr_session *session = wlr_session_create(disp); + struct wl_event_loop *event_loop = wl_display_get_event_loop(disp); + struct wlr_session *session = wlr_session_create(event_loop); if (!session) { wlr_log(WLR_ERROR, "Failed to start a session"); @@ -85,8 +86,6 @@ static struct wlr_session *session_create_and_wait(struct wl_display *disp) { int64_t started_at = get_current_time_msec(); int64_t timeout = WAIT_SESSION_TIMEOUT; - struct wl_event_loop *event_loop = - wl_display_get_event_loop(session->display); while (!session->active) { int ret = wl_event_loop_dispatch(event_loop, (int)timeout); @@ -234,7 +233,7 @@ static bool attempt_drm_backend(struct wl_display *display, } if (getenv("WLR_DRM_DEVICES") == NULL) { - drm_backend_monitor_create(backend, primary_drm, session); + drm_backend_monitor_create(backend, primary_drm, session, display); } return true; -- cgit v1.2.3