toast when input capture fails

This commit is contained in:
galister 2026-07-24 03:25:51 +09:00
parent 67877d6a5f
commit 239337ae76
2 changed files with 13 additions and 2 deletions

View File

@ -24,6 +24,8 @@ use std::{
time::{Duration, Instant},
};
use crate::subsystem::dbus::DbusConnector;
const IGNORE_PREFIX: &str = "WayVR";
const WATCHDOG_TIMEOUT: Duration = Duration::from_millis(5000);
const POLL_TIMEOUT_MS: i32 = 20;
@ -486,7 +488,16 @@ fn worker_main(
}
}
Err(error) => {
log::warn!("Could not grab input devices after Super+Tab: {error}");
//TODO: translate
let _ = DbusConnector::notify_send(
"Could not capture input",
&format!("Linux user must be in input group!\n Error: \n{error}"),
1,
5000,
0,
true,
);
log::warn!("Could not grab input devices: {error}");
}
}
}

View File

@ -896,7 +896,7 @@ impl WvrServerState {
audio_sample_player.play_sample(audio_system, "input_grab");
if !self.grab_toast_sent {
self.grab_toast_sent = true;
//TODO: toast
//TODO: translate
let _ = DbusConnector::notify_send(
"WayVR has your keyboard and mouse!",
"Super+Z to release",