Input source: Update monado devices only if they are available

Fixes .unwrap() panic in the simulated Monado driver
This commit is contained in:
Aleksander
2024-08-02 22:08:37 +02:00
committed by galister
parent c3c8694e1a
commit aca177635e

View File

@@ -212,9 +212,11 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
}
if next_device_update <= Instant::now() {
input_source.update_devices(&mut app_state, monado.as_mut().unwrap());
if let Some(monado) = &mut monado {
input_source.update_devices(&mut app_state, monado);
next_device_update = Instant::now() + Duration::from_secs(30);
}
}
if !session_running {
std::thread::sleep(Duration::from_millis(100));