1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Fix cursor not hiding with SDL2 backend

This commit is contained in:
Shane Woolcock 2020-06-11 13:02:47 +09:30
parent 969d0b7228
commit b89dcb6a77

View File

@ -122,14 +122,22 @@ namespace osu.Desktop
{
base.SetHost(host);
if (host.Window is DesktopGameWindow desktopWindow)
switch (host.Window)
{
desktopWindow.CursorState |= CursorState.Hidden;
// Legacy osuTK DesktopGameWindow
case DesktopGameWindow desktopGameWindow:
desktopGameWindow.CursorState |= CursorState.Hidden;
desktopGameWindow.SetIconFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"));
desktopGameWindow.Title = Name;
desktopGameWindow.FileDrop += fileDrop;
break;
desktopWindow.SetIconFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"));
desktopWindow.Title = Name;
desktopWindow.FileDrop += fileDrop;
// SDL2 DesktopWindow
case DesktopWindow desktopWindow:
desktopWindow.CursorState.Value |= CursorState.Hidden;
desktopWindow.Title = Name;
desktopWindow.FileDrop += fileDrop;
break;
}
}