From 1d99b16685a7d1f663dad8c4043e933dd91bf3a7 Mon Sep 17 00:00:00 2001 From: Slendi Date: Sun, 29 Jun 2025 17:06:08 +0300 Subject: [PATCH] Fix openxr gl glue Signed-off-by: Slendi --- src/wlr/openxr_gl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wlr/openxr_gl.cpp b/src/wlr/openxr_gl.cpp index f5c4b03..de09067 100644 --- a/src/wlr/openxr_gl.cpp +++ b/src/wlr/openxr_gl.cpp @@ -58,6 +58,7 @@ static const struct wlr_output_impl output_impl = { struct openxr_backend { wlr_backend base; wl_display* display; + wl_event_loop* event_loop; XrInstance instance {}; XrSession session {}; bool started = false; @@ -158,8 +159,10 @@ static bool backend_start(wlr_backend* backend) xr->output = static_cast(calloc(1, sizeof(wlr_output))); if (xr->output) { - wlr_output_init(xr->output, &xr->base, &output_impl, "OpenXR"); - wlr_output_create_global(xr->output); + wlr_output_init( + xr->output, &xr->base, &output_impl, xr->event_loop, nullptr); + wlr_output_set_name(xr->output, "OpenXR"); + wlr_output_create_global(xr->output, xr->display); } xr->started = true; @@ -193,11 +196,12 @@ static wlr_backend_impl const backend_impl = { wlr_backend* wlr_openxr_backend_create(wl_display* display, wl_event_loop* loop) { - (void)loop; - auto* b = static_cast(calloc(1, sizeof(*b))); + openxr_backend* b = static_cast(calloc(1, sizeof(*b))); + if (!b) return nullptr; b->display = display; + b->event_loop = loop; wlr_backend_init(&b->base, &backend_impl); return &b->base; }