1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-22 07:52:56 +08:00

Update inline with framework IWindow changes

This commit is contained in:
Susko3 2023-07-01 19:02:09 +02:00
parent fe2ca5cfef
commit e38ac4185c
2 changed files with 5 additions and 7 deletions

View File

@ -147,14 +147,12 @@ namespace osu.Desktop
{ {
base.SetHost(host); base.SetHost(host);
var desktopWindow = (SDL2DesktopWindow)host.Window;
var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"); var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
if (iconStream != null) if (iconStream != null)
desktopWindow.SetIconFromStream(iconStream); host.Window.SetIconFromStream(iconStream);
desktopWindow.CursorState |= CursorState.Hidden; host.Window.CursorState |= CursorState.Hidden;
desktopWindow.Title = Name; host.Window.Title = Name;
} }
protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo(); protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo();

View File

@ -289,9 +289,9 @@ namespace osu.Game
{ {
base.SetHost(host); base.SetHost(host);
if (host.Window is SDL2Window sdlWindow) if (host.Window != null)
{ {
sdlWindow.DragDrop += path => host.Window.DragDrop += path =>
{ {
// on macOS/iOS, URL associations are handled via SDL_DROPFILE events. // on macOS/iOS, URL associations are handled via SDL_DROPFILE events.
if (path.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal)) if (path.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal))