From bc1a01041110878aa04bf040f07e7288e561b464 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 30 Oct 2026 10:34:30 -0400 Subject: [PATCH] fix: launching a game from a frontend starts it instead of sitting on the home screen (#1844) --- .../java/com/droiddeck/launcher/FrontEndActivity.kt | 10 +++++++--- .../com/droiddeck/launcher/runtime/LinuxRuntime.java | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt index e3e7db6ecd..7e1f162e91 100644 --- a/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/FrontEndActivity.kt @@ -740,7 +740,10 @@ class FrontEndActivity : ComponentActivity() { if (id == null) { syncDualPanel() android.widget.Toast.makeText(this, R.string.game_link_invalid, android.widget.Toast.LENGTH_LONG).show() - } else refresh() + } else { + handleGameLink(steamGames, scanned = false) + refresh() + } } } }, "game-launch-file").start() @@ -943,9 +946,10 @@ class FrontEndActivity : ComponentActivity() { ui.postDelayed(poll, SESSION_SWITCH_POLL_MS) } - private fun handleGameLink(games: List) { + private fun handleGameLink(games: List, scanned: Boolean = true) { if (!lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.RESUMED)) return val id = pendingGameLink ?: return + if (!scanned && games.none { it.gameIdString == id }) return gameLinkTried = true ui.postDelayed({ if (!isDestroyed && lifecycle.currentState.isAtLeast(androidx.lifecycle.Lifecycle.State.RESUMED)) syncDualPanel() @@ -2511,7 +2515,7 @@ class FrontEndActivity : ComponentActivity() { } val scannedArch = SessionPrefs.activeSteamClientArch(this) val scannedX64 = scannedArch == "x86_64" - val games = if (ready) Library.launchableGames(this, arch = scannedArch) else emptyList() + val games = if (ready || com.droiddeck.launcher.runtime.LinuxRuntime.hasRootfs(this)) Library.launchableGames(this, arch = scannedArch) else emptyList() val all = games.distinctBy { it.gameId } if (ready && scanGeneration == libraryScanGeneration) com.droiddeck.launcher.frontend.LibraryCache.save(this, all, scannedX64) val endedSession = SessionState.sessionId.takeIf { !SessionState.running && it != null && it != componentSweepSession } diff --git a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java index 81f005ab7d..04926193ac 100644 --- a/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java +++ b/app/src/main/java/com/droiddeck/launcher/runtime/LinuxRuntime.java @@ -113,12 +113,16 @@ public final class LinuxRuntime { } public static boolean isInstalled(Context context) { + return hasRootfs(context) && (patchedProot(context) || rootfsProotReady(context)); + } + + /** The rootfs alone: enough to read the game library, while the proot pack can still be downloading. */ + public static boolean hasRootfs(Context context) { if (LinuxRuntimeInstaller.isRemoving() || LinuxRuntimeInstaller.hasRemovalPending(context)) return false; File root = rootDir(context); return (new File(root, "usr/bin/gamescope").isFile() || new File(root, "usr/games/gamescope").isFile()) && (new File(root, SESSION_SCRIPT.substring(1)).isFile() - || new File(root, LegacyNames.SESSION_SCRIPT.substring(1)).isFile()) - && (patchedProot(context) || rootfsProotReady(context)); + || new File(root, LegacyNames.SESSION_SCRIPT.substring(1)).isFile()); } public static File vulkanIcd(Context context) {