1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 05:52:54 +08:00

Hide the game-wide cursor on touch input

This commit is contained in:
Dean Herbert 2020-09-07 15:18:15 +09:00
parent a0bc376446
commit daff060c9a

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input;
using osu.Framework.Input.StateChanges;
namespace osu.Game.Graphics.Cursor
{
@ -47,7 +48,10 @@ namespace osu.Game.Graphics.Cursor
{
base.Update();
if (!CanShowCursor)
var lastMouseSource = GetContainingInputManager().CurrentState.Mouse.LastSource;
bool hasValidInput = lastMouseSource != null && !(lastMouseSource is ISourcedFromTouch);
if (!hasValidInput || !CanShowCursor)
{
currentTarget?.Cursor?.Hide();
currentTarget = null;