fix: better handling of wivrn launch opts

This commit is contained in:
Gabriele Musco 2025-02-05 07:53:56 +01:00
commit 9098800298
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE

View file

@ -18,7 +18,9 @@ use std::{
thread, thread,
}; };
static WIVRN_LAUNCH_OPTS: [&str; 2] = ["--no-instructions", "--no-manage-active-runtime"]; /// launch options that are desirable on wivrn, no way currently to remove them
/// but it should be fine
const 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) => {
@ -196,13 +198,12 @@ impl InternalJobWorker {
launch_opts launch_opts
}; };
if prof.xrservice_type == XRServiceType::Wivrn { if prof.xrservice_type == XRServiceType::Wivrn {
let mut opts = WIVRN_LAUNCH_OPTS.to_vec(); for wivrn_opt in WIVRN_LAUNCH_OPTS {
opts.retain(|opt| !launch_opts.contains(opt)); if !launch_opts.contains(wivrn_opt) {
opts.iter().for_each(|opt| {
launch_opts.push(' '); launch_opts.push(' ');
launch_opts.push_str(opt); launch_opts.push_str(wivrn_opt);
}); }
}
} }
let (command, args) = match launch_opts.is_empty() { let (command, args) = match launch_opts.is_empty() {
false => ( false => (