fix(sleep-inhibitor): keep linux state on probe error

This commit is contained in:
Yaroslav Volovich
2026-02-18 11:08:16 +00:00
parent ece9757260
commit e182331dc7
@@ -56,6 +56,7 @@ impl PlatformSleepInhibitor for LinuxSleepInhibitor {
reason = %error,
"Failed to query Linux sleep inhibitor backend status"
);
return;
}
}
}
@@ -152,7 +153,7 @@ fn spawn_backend(backend: LinuxBackend) -> Result<Child, std::io::Error> {
match backend {
LinuxBackend::SystemdInhibit => Command::new("systemd-inhibit")
.args([
"--what=sleep",
"--what=idle",
"--mode=block",
"--who",
APP_ID,
@@ -166,7 +167,7 @@ fn spawn_backend(backend: LinuxBackend) -> Result<Child, std::io::Error> {
LinuxBackend::GnomeSessionInhibit => Command::new("gnome-session-inhibit")
.args([
"--inhibit",
"suspend",
"idle",
"--reason",
ASSERTION_REASON,
"sleep",