From e38ac4185cdd630a105452d19c6bdf627e794621 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sat, 1 Jul 2023 19:02:09 +0200 Subject: [PATCH] Update inline with framework `IWindow` changes --- osu.Desktop/OsuGameDesktop.cs | 8 +++----- osu.Game/OsuGame.cs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index efd3d358b7..a0db896f46 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -147,14 +147,12 @@ namespace osu.Desktop { base.SetHost(host); - var desktopWindow = (SDL2DesktopWindow)host.Window; - var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"); if (iconStream != null) - desktopWindow.SetIconFromStream(iconStream); + host.Window.SetIconFromStream(iconStream); - desktopWindow.CursorState |= CursorState.Hidden; - desktopWindow.Title = Name; + host.Window.CursorState |= CursorState.Hidden; + host.Window.Title = Name; } protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo(); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 93dd97ea15..5b654e0c16 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -289,9 +289,9 @@ namespace osu.Game { 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. if (path.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal))