fix(app): advance logic timers by wall-clock time
Logic timers advanced by io.DeltaTime, which update() clamps to 0.25 s so animations don't jump after a pause. That matched real time only while the main loop rendered continuously: with frames seconds apart, a timer fed the clamped delta runs up to 8x slow. Affected: the refresh scheduler, the seed-migration poll, the chat fast scan, the encryption check, the loading and shutdown timers, the lock-screen countdowns, the Settings debug gate and the mining benchmark. - App::logicDeltaTime(): steady-clock seconds since the previous update(), capped at 6 s so a sleep/resume fires each timer once instead of replaying the gap. Visual interpolation keeps the clamped io.DeltaTime. - The refresh timers tick before the RPC results are drained, so a hold that a callback arms (the connect-retry backoff) starts fresh instead of being charged the gap before it existed. - The shutdown timer is measured from shutdown_start_time_: beginShutdown runs from SDL event handling, so an accumulated delta would count the idle gap before the close request. - The lock-screen error and lockout countdowns subtract only the time since they were armed: a failed unlock arms them from an RPC result, which can land on the frame that ends an idle gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2865,7 +2865,7 @@ void RenderSettingsPage(App* app) {
|
||||
if (s_settingsState.debug_gate_open) {
|
||||
auto& st = s_settingsState;
|
||||
if (st.debug_gate_err_timer > 0.0f) {
|
||||
st.debug_gate_err_timer -= ImGui::GetIO().DeltaTime;
|
||||
st.debug_gate_err_timer -= app->logicDeltaTime();
|
||||
if (st.debug_gate_err_timer <= 0.0f) st.debug_gate_err.clear();
|
||||
}
|
||||
const bool needAuth = app->debugGateRequiresAuth();
|
||||
|
||||
@@ -249,7 +249,7 @@ static void RenderMiningTabContent(App* app)
|
||||
// ================================================================
|
||||
if (s_benchmark.active()) {
|
||||
auto benchmarkUpdate = AdvanceThreadBenchmark(
|
||||
s_benchmark, ImGui::GetIO().DeltaTime, state.pool_mining.hashrate_10s);
|
||||
s_benchmark, app->logicDeltaTime(), state.pool_mining.hashrate_10s);
|
||||
if (benchmarkUpdate.stopPoolMining) {
|
||||
app->stopPoolMining();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user