Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

fix(launch): show the progress panel on every launch, not just slow ones (#1830)

Raystorms977cdff082e8
diff --git a/app/Sources/BridgeplayApp/Support/LaunchProgress.swift b/app/Sources/BridgeplayApp/Support/LaunchProgress.swift
index 0d3682a..ecd278a 100644
--- a/app/Sources/BridgeplayApp/Support/LaunchProgress.swift
+++ b/app/Sources/BridgeplayApp/Support/LaunchProgress.swift
@@ -45,8 +45,9 @@ enum LaunchStep: String {
struct LaunchProgress {
// A later launch that shows its window within this many seconds shows nothing. Hell Maiden
- // took 12s from the run script to its window on an M4, its first launch 27 to 76s.
- static let laterDelay: TimeInterval = 20
+ // took 12s from the run script to its window on an M4, so most relaunches would never show
+ // the panel at 20s; 3s still skips a launch that fails straight away but catches those.
+ static let laterDelay: TimeInterval = 3
// Long enough that a launch failing straight away does not flash the panel.
static let firstDelay: TimeInterval = 1
// In case the game hangs before opening anything; Steam's Stop still ends it.
diff --git a/app/Tests/BridgeplayAppTests/LaunchProgressTests.swift b/app/Tests/BridgeplayAppTests/LaunchProgressTests.swift
index fab1aa4..6c89dda 100644
--- a/app/Tests/BridgeplayAppTests/LaunchProgressTests.swift
+++ b/app/Tests/BridgeplayAppTests/LaunchProgressTests.swift
@@ -9,13 +9,14 @@ struct LaunchProgressTests {
private let first = LaunchProgress(firstLaunch: true)
private let later = LaunchProgress(firstLaunch: false)
- @Test("A first launch shows almost at once, a later one only when it is slow")
+ @Test("A first launch shows almost at once, a later one shortly after")
func delays() {
#expect(first.action(step: .setup, elapsed: 0.5, launchEnded: false, gameWindow: false) == .hidden)
#expect(first.action(step: .setup, elapsed: 1, launchEnded: false, gameWindow: false) == .shown(.setup))
- // Hell Maiden's relaunch opened its window 12s in, which must not flash a panel.
- #expect(later.action(step: .start, elapsed: 12, launchEnded: false, gameWindow: false) == .hidden)
- #expect(later.action(step: .start, elapsed: 20, launchEnded: false, gameWindow: false) == .shown(.start))
+ // Hell Maiden's relaunch opened its window 12s in; most relaunches land around there, so
+ // the delay must be well under that to actually show for them.
+ #expect(later.action(step: .start, elapsed: 2, launchEnded: false, gameWindow: false) == .hidden)
+ #expect(later.action(step: .start, elapsed: 3, launchEnded: false, gameWindow: false) == .shown(.start))
}
@Test("The game's window, the end of the launch or its end take the panel away")
@@ -24,7 +25,7 @@ struct LaunchProgressTests {
#expect(first.action(step: .setup, elapsed: 30, launchEnded: true, gameWindow: false) == .quit)
#expect(first.action(step: .ended, elapsed: 30, launchEnded: false, gameWindow: false) == .quit)
// Before its delay too, so a fast launch never shows it.
- #expect(later.action(step: .start, elapsed: 3, launchEnded: false, gameWindow: true) == .quit)
+ #expect(later.action(step: .start, elapsed: 2, launchEnded: false, gameWindow: true) == .quit)
#expect(later.action(step: .start, elapsed: LaunchProgress.limit, launchEnded: false, gameWindow: false) == .quit)
}