From 5ad8dc316fa1aeed2f2dc194c2f9520b7f93ba09 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Mar 2021 14:09:15 +0900 Subject: [PATCH] Add inline comment and improve linq robustness --- osu.Game.Tournament/TournamentGame.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index bf43b198c4..87e23e3404 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -51,8 +51,12 @@ namespace osu.Game.Tournament Margin = new MarginPadding(40), }); - var m = (MouseHandler)host.AvailableInputHandlers.Single(t => t is MouseHandler); - m.UseRelativeMode.Value = false; + // in order to have the OS mouse cursor visible, relative mode needs to be disabled. + // can potentially be removed when https://github.com/ppy/osu-framework/issues/4309 is resolved. + var mouseHandler = host.AvailableInputHandlers.OfType().FirstOrDefault(); + + if (mouseHandler != null) + mouseHandler.UseRelativeMode.Value = false; loadingSpinner.Show();