Settings: apply the VR View KWin rule from packaged installs

This commit is contained in:
lbgos committed 2026-10-14 15:23:12 +03:00
1 parent 09680d2c3c
commit d82b8cbdac
1 file changed
+20
+20
View File
@@ -214,9 +214,29 @@ fn preview_preference(app: tauri::AppHandle, enabled: Option<bool>) -> Result<bo
fs::create_dir_all(directory).map_err(|e| e.to_string())?;
fs::write(marker, b"").map_err(|e| e.to_string())?;
}
if requested == Some(true) && value != 0 {
install_vrview_rule();
}
Ok(value != 0)
}
/// Packages ship the KWin rule that keeps the VR View source minimized; apply it
/// for the current user when the full-resolution preview is enabled.
fn install_vrview_rule() {
let Some(script) = std::env::current_exe()
.ok()
.and_then(|exe| Some(exe.parent()?.parent()?.join("share/rifts-settings/install-vrview-rule.sh")))
.filter(|path| path.is_file())
else {
return;
};
let _ = Command::new("bash")
.arg(script)
.stdout(Stdio::null())
.stderr(Stdio::null())
.status();
}
#[tauri::command]
fn preview_status() -> Value {
let (mut presented, mut width, mut height) = (0, 0, 0);