Skip to content

Conversation

@danprice142
Copy link

Summary
This PR adds support for protocol activation on UWP/WinRT platforms, allowing UWP applications to be launched via custom URI schemes and retrieve the activation URI at runtime.

Changes
Added SDL_WinRTGetProtocolActivationURI() API function to retrieve protocol activation URIs
Added protocol URI capture in OnAppActivated() when activation kind is Protocol
Stores the URI in a global variable that can be retrieved once by the application
Returns URI as UTF-8 string (caller must free with SDL_free())
Use Case
This enables UWP/Xbox applications to be launched via custom URI schemes (e.g., myapp://action?param=value) and process the URI parameters at runtime. This is particularly useful for:

Game launchers that need to pass ROM/content paths
Deep linking into specific application states
Inter-app communication on UWP platforms
API Addition
extern "C" char* SDL_WinRTGetProtocolActivationURI(void);

@slouken
Copy link
Collaborator

slouken commented Oct 23, 2025

I don't see SDL_WinRTGetProtocolActivationURI() in a public header, should it be added somewhere?

Moved SDL_WinRTGetProtocolActivationURI() to public API in SDL_system.h

Addresses feedback from PR #14309:
- Removed extern declaration from SDL_winrtapp_common.h
- Made WINRT_ProtocolActivationURI static in SDL_winrtapp_direct3d.cpp
- Fixed version to SDL 2.33.0
@danprice142 danprice142 requested a review from icculus October 24, 2025 08:10
@slouken slouken merged commit 3e1cebe into libsdl-org:SDL2 Oct 24, 2025
34 checks passed
@slouken
Copy link
Collaborator

slouken commented Oct 24, 2025

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants