From 65a9957be1fb93aa630d55bc5db20f0cdee23c1f Mon Sep 17 00:00:00 2001 From: Nova Date: Fri, 14 Jun 2024 22:33:08 -0400 Subject: [PATCH] fix(wayland): context in xr --- src/main.rs | 4 ++-- src/session.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 98c17f5..78b0792 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,6 +201,8 @@ fn stereokit_loop( #[cfg(feature = "wayland")] let mut wayland = wayland::Wayland::new().expect("Could not initialize wayland"); + #[cfg(feature = "wayland")] + wayland.make_context_current(); sk_ready_notifier.notify_waiters(); info!("Stardust ready!"); @@ -232,8 +234,6 @@ fn stereokit_loop( wayland.update(); drawable::draw(token); audio::update(); - #[cfg(feature = "wayland")] - wayland.make_context_current(); } }); diff --git a/src/session.rs b/src/session.rs index 77b2f64..9f55e64 100644 --- a/src/session.rs +++ b/src/session.rs @@ -1,5 +1,6 @@ use crate::core::client::CLIENTS; use crate::core::client_state::ClientStateParsed; +#[cfg(feature = "wayland")] use crate::wayland::WAYLAND_DISPLAY; use crate::{CliArgs, STARDUST_INSTANCE}; use directories::ProjectDirs;