From 46274269944c6a68fe7dacd0355c3f7bc4ac24ff Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 6 Oct 2020 00:42:17 -0400 Subject: [PATCH] url: WinRT actually works now (and has been tested, hooray!). --- VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters | 9 +++++++++ src/misc/winrt/SDL_sysurl.cpp | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters index 14619dd03..e4ec4e4a6 100644 --- a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters @@ -438,6 +438,9 @@ Source Files + + Header Files + @@ -791,5 +794,11 @@ Source Files + + Source Files + + + Source Files + \ No newline at end of file diff --git a/src/misc/winrt/SDL_sysurl.cpp b/src/misc/winrt/SDL_sysurl.cpp index 69393cb10..d2bd4de9f 100644 --- a/src/misc/winrt/SDL_sysurl.cpp +++ b/src/misc/winrt/SDL_sysurl.cpp @@ -21,17 +21,22 @@ #include +#include "../../core/windows/SDL_windows.h" #include "../SDL_sysurl.h" int SDL_SYS_OpenURL(const char *url) { - Platform::String^ strurl = url; + WCHAR *wurl = WIN_UTF8ToString(url); + if (!wurl) { + return SDL_OutOfMemory(); + } + auto strurl = ref new Platform::String(wurl); SDL_free(wurl); auto uri = ref new Windows::Foundation::Uri(strurl); - launchUriOperation(Windows::System::Launcher::LaunchUriAsync(uri)); - return 0; + Windows::System::Launcher::LaunchUriAsync(uri); + return 0; // oh well, we're not waiting on an async task here. } /* vi: set ts=4 sw=4 expandtab: */