fix(linux): recheck PreparingForSleep right before starting --server

should_start_server reads the property before force_stop_server() (a
kill plus 300 ms) and, on the DRM greeter path, before the 1 s grace
that precedes the root fallback. A sleep requested in that gap still got
a --server. Check again in start_server; the skipped start is retried on
the next tick as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
This commit is contained in:
rustdeskandClaude Opus 5.5 committed 2026-12-04 15:18:29 +08:00
1 parent 0c80b1be31
commit f3610db846
1 file changed
+5
+5
View File
@@ -1142,6 +1142,11 @@ fn try_start_server_(desktop: Option<&Desktop>) -> ResultType<Option<Child>> {
#[inline]
fn start_server(desktop: Option<&Desktop>, server: &mut Option<Child>) {
// should_start_server checked before force_stop_server() and the DRM greeter grace, so a
// sleep requested in between would otherwise still get a --server.
if is_system_preparing_for_sleep() {
return;
}
match try_start_server_(desktop) {
Ok(ps) => *server = ps,
Err(err) => {