fix: better handling of wivrn launch opts

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

View file

@ -18,7 +18,9 @@ use std::{
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 {
($buf_fd: expr, $sender: expr) => {
@ -196,13 +198,12 @@ impl InternalJobWorker {
launch_opts
};
if prof.xrservice_type == XRServiceType::Wivrn {
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);
});
for wivrn_opt in WIVRN_LAUNCH_OPTS {
if !launch_opts.contains(wivrn_opt) {
launch_opts.push(' ');
launch_opts.push_str(wivrn_opt);
}
}
}
let (command, args) = match launch_opts.is_empty() {
false => (