Merge pull request #22913 from Susko3/macos-fix-osu-urls

Fix `osu://` URL handling on macOS
This commit is contained in:
Dean Herbert 2023-03-20 13:40:13 +09:00 committed by GitHub
commit 65e1d98ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -139,7 +139,17 @@ public override void SetHost(GameHost host)
desktopWindow.CursorState |= CursorState.Hidden;
desktopWindow.Title = Name;
desktopWindow.DragDrop += f => fileDrop(new[] { f });
desktopWindow.DragDrop += f =>
{
// on macOS, URL associations are handled via SDL_DROPFILE events.
if (f.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal))
{
HandleLink(f);
return;
}
fileDrop(new[] { f });
};
}
protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo();