fix: prevent wivrn from overriding openvr runtime

Without this flag, WiVRn would set the OpenVR runtime to a system installation if available.
This commit is contained in:
Sapphire 2025-02-01 16:37:16 -06:00
commit 0f3e6970bb
No known key found for this signature in database
GPG key ID: 642911AA4025C8CC

View file

@ -3,7 +3,7 @@ use super::{
state::JobWorkerState, state::JobWorkerState,
}; };
use crate::{ use crate::{
profile::{LighthouseDriver, Profile}, profile::{LighthouseDriver, Profile, XRServiceType},
ui::SENDER_IO_ERR_MSG, ui::SENDER_IO_ERR_MSG,
}; };
use nix::unistd::Pid; use nix::unistd::Pid;
@ -18,6 +18,8 @@ use std::{
thread, thread,
}; };
static WIVRN_LAUNCH_OPTS: [&str; 2] = ["--no-instructions", "--no-manage-active-runtime"];
macro_rules! logger_thread { macro_rules! logger_thread {
($buf_fd: expr, $sender: expr) => { ($buf_fd: expr, $sender: expr) => {
thread::spawn(move || { thread::spawn(move || {
@ -193,8 +195,14 @@ impl InternalJobWorker {
} else { } else {
launch_opts launch_opts
}; };
if !launch_opts.contains(" --no-instructions") { if prof.xrservice_type == XRServiceType::Wivrn {
launch_opts.push_str(" --no-instructions"); let mut opts = WIVRN_LAUNCH_OPTS.to_vec();
opts.retain(|opt| !launch_opts.contains(opt));
opts.iter().for_each(|opt| {
launch_opts.push(' ');
launch_opts.push_str(opt);
});
} }
let (command, args) = match launch_opts.is_empty() { let (command, args) = match launch_opts.is_empty() {
false => ( false => (