From 250c7403e87f88c65139a55792902dc8d173a995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 17 Apr 2021 13:50:00 +0200 Subject: [PATCH] Fix idle tracker assuming time starts at 0 `IdleTracker` in its construction quietly assumed that the clock it receives from its parent starts ticking from 0 at the point at which it is passed down. This is not necessarily the case when headless executions are involved, which means that the initial state of the tracker could be computed as idle incorrectly. Resolve by explicitly reading the clock time at the point of `LoadComplete()`. --- osu.Game/Input/IdleTracker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Input/IdleTracker.cs b/osu.Game/Input/IdleTracker.cs index 63a6348b57..2d6a21d1cf 100644 --- a/osu.Game/Input/IdleTracker.cs +++ b/osu.Game/Input/IdleTracker.cs @@ -42,6 +42,12 @@ public IdleTracker(double timeToIdle) RelativeSizeAxes = Axes.Both; } + protected override void LoadComplete() + { + base.LoadComplete(); + updateLastInteractionTime(); + } + protected override void Update() { base.Update();