From 6487bf45cff7f69e61cedb5718ee88b1317d82c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 17:55:35 +0900 Subject: [PATCH] Eagerly attempt to pause the game when the window is not focused --- osu.Game/Screens/Play/Player.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index de390b63b3..8ee0de12b9 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -224,6 +224,15 @@ namespace osu.Game.Screens.Play }; } + protected override void Update() + { + // eagerly pause when we lose window focus (if we are locally playing). + if (!Game.IsActive && !HitRenderer.HasReplayLoaded) + Pause(); + + base.Update(); + } + private void initializeSkipButton() { const double skip_required_cutoff = 3000;