mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
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.
This commit is contained in:
parent
f1762f428b
commit
63792b38e4
5 changed files with 24 additions and 28 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue