From b61f766b66604222c7e5ef159e76674c5afa098e Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 4 Dec 2026 08:54:51 -0500 Subject: [PATCH] fix(session): sleep freezes the programs that run in worker processes (#3665) With the native session, gamescope, Xwayland, wineserver and the game each run in a worker process of their own: none descends from the session root, so the freeze on sleep left them running. On wake the resume still added the frozen time to the guest clock shift, and every one of them saw its monotonic clock jump back by the length of the sleep. Unreal games abort on that: KINGDOM HEARTS III failed with "Detected negative delta time" (DeltaTime -10.05 s after a 13 s sleep). The freeze now treats the session's worker programs as helper roots, as the teardown already does. --- .../java/com/droiddeck/launcher/session/SessionService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt index 9ef1456616..67992024db 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionService.kt @@ -945,11 +945,15 @@ class SessionService : Service() { return } if (gen == sessionGen && SessionState.running) { + val workers = ownWorkers suspendController = SessionSuspendController( sessionRoot = { sessionPid }, + // Programs handed off to worker processes are not descendants of the session root, and + // the clock shift applied at resume would move their monotonic time backwards. helperRoots = { components.mapNotNull { it.suspendPid().takeIf { pid -> pid > 1 } } + - listOfNotNull(BottomDesktop.suspendPid.takeIf { it > 1 }) + listOfNotNull(BottomDesktop.suspendPid.takeIf { it > 1 }) + + (if (workers > 0) com.droiddeck.launcher.runtime.GuestWorkers.guestPids(workers) else emptyList()) }, suspendAudio = { if (!pulse.setSinkSuspended(true)) Log.w(TAG, "could not suspend audio sink")