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;