mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-30 11:11:21 -04:00
backend/wayland: take wl_event_loop instead of wl_display
This commit is contained in:
parent
f5e8fa48f3
commit
ed0bba581b
6 changed files with 16 additions and 17 deletions
|
|
@ -480,7 +480,7 @@ static void backend_destroy(struct wlr_backend *backend) {
|
|||
|
||||
wlr_backend_finish(backend);
|
||||
|
||||
wl_list_remove(&wl->local_display_destroy.link);
|
||||
wl_list_remove(&wl->event_loop_destroy.link);
|
||||
|
||||
wl_event_source_remove(wl->remote_display_src);
|
||||
|
||||
|
|
@ -561,13 +561,12 @@ bool wlr_backend_is_wl(struct wlr_backend *b) {
|
|||
return b->impl == &backend_impl;
|
||||
}
|
||||
|
||||
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||
struct wlr_wl_backend *wl =
|
||||
wl_container_of(listener, wl, local_display_destroy);
|
||||
static void handle_event_loop_destroy(struct wl_listener *listener, void *data) {
|
||||
struct wlr_wl_backend *wl = wl_container_of(listener, wl, event_loop_destroy);
|
||||
backend_destroy(&wl->backend);
|
||||
}
|
||||
|
||||
struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
|
||||
struct wlr_backend *wlr_wl_backend_create(struct wl_event_loop *loop,
|
||||
struct wl_display *remote_display) {
|
||||
wlr_log(WLR_INFO, "Creating wayland backend");
|
||||
|
||||
|
|
@ -579,7 +578,7 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
|
|||
|
||||
wlr_backend_init(&wl->backend, &backend_impl);
|
||||
|
||||
wl->local_display = display;
|
||||
wl->event_loop = loop;
|
||||
wl_list_init(&wl->outputs);
|
||||
wl_list_init(&wl->seats);
|
||||
wl_list_init(&wl->buffers);
|
||||
|
|
@ -644,7 +643,6 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
|
|||
zwp_linux_dmabuf_feedback_v1_destroy(linux_dmabuf_feedback_v1);
|
||||
}
|
||||
|
||||
struct wl_event_loop *loop = wl_display_get_event_loop(wl->local_display);
|
||||
int fd = wl_display_get_fd(wl->remote_display);
|
||||
wl->remote_display_src = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
|
||||
dispatch_events, wl);
|
||||
|
|
@ -666,8 +664,8 @@ struct wlr_backend *wlr_wl_backend_create(struct wl_display *display,
|
|||
wl->drm_fd = -1;
|
||||
}
|
||||
|
||||
wl->local_display_destroy.notify = handle_display_destroy;
|
||||
wl_display_add_destroy_listener(display, &wl->local_display_destroy);
|
||||
wl->event_loop_destroy.notify = handle_event_loop_destroy;
|
||||
wl_event_loop_add_destroy_listener(loop, &wl->event_loop_destroy);
|
||||
|
||||
const char *token = getenv("XDG_ACTIVATION_TOKEN");
|
||||
if (token != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue