fix(dual-screen): open the bottom-screen Dashboard in every session, not only the first

SessionActivity.onCreate checks for a new session twice. The first block calls
SessionEvents.begin(), which moves the phase to PREPARING, so the second block
with the same condition never runs. The per-session reset of
secondScreenAutoOpened / secondScreenProvisional lived in that second block, so
after the first session in an app process the bottom screen stayed empty when
Steam was started again (seen on a Retroid Pocket Duo).

Reset both flags in the first block, right after begin().
This commit is contained in:
The412Banner committed 2026-11-01 03:31:46 +00:00
1 parent 8a7022fc14
commit abaabc54c0
1 file changed
+3 -2
@@ -581,6 +581,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
val mode = intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM
SessionState.programArgs = intent.getStringArrayExtra(SessionService.EXTRA_PROGRAM_ARGS)?.toList().orEmpty()
SessionEvents.begin(this, mode, SessionPaths.label(mode, intent.getStringExtra(SessionService.EXTRA_PROGRAM)))
// begin() moves the phase on, so the block below never runs for a new session; reset per-session flags here.
SessionState.secondScreenAutoOpened = false
SessionState.secondScreenProvisional = false
}
if (!SessionState.running && SessionState.phase in setOf(SessionPhase.IDLE, SessionPhase.FAILED)) {
SessionState.program = intent.getStringExtra(SessionService.EXTRA_PROGRAM)
@@ -588,8 +591,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
SessionState.steamUi = intent.getStringExtra(SessionService.EXTRA_STEAM_UI)
SessionState.steamUrl = intent.getStringExtra(SessionService.EXTRA_STEAM_URL)
SessionState.steamVr = intent.getBooleanExtra(EXTRA_STEAMVR, false)
SessionState.secondScreenAutoOpened = false
SessionState.secondScreenProvisional = false
} else if (intent.getBooleanExtra(EXTRA_STEAMVR, false) && SessionState.mode == SessionService.MODE_STEAM) {
SessionState.steamVr = true
}