rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.7k stars 887 forks source link

Feature request: Custom URI handling #2190

Open FredrikNoren opened 2 years ago

FredrikNoren commented 2 years ago

Hi!

I'm not sure if it's in scope of winit or not, but it would be fantastic if it handled custom uri's; like this: https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

https://github.com/maidsafe-archive/system_uri does provide the registration functionality, and it works if the app isn't already running (the app opens with an argument with the uri). But if the app is already running I think something more needs to be done to handle it (at least on OSX). I haven't looked into it in detail, but it feels like it would fit pretty well as a WindowEvent.

madsmtm commented 2 years ago

Related: #1759.

Not sure if this is supported on other platforms?

maroider commented 2 years ago

Of the desktop platforms, macOS seems to be the only one requiring hooking into winit in some manner. On Windows and Linux, the application is just started a second time if the application is already running, and I suspect Android and iOS will have similar issues as macOS.

nicoburns commented 1 year ago

Iced has been maintaining a fork of winit primarily for this feature (implementation here: https://github.com/iced-rs/winit/pull/1/files). Would winit be open to accepting this upstream?

Xaeroxe commented 1 year ago

I'd love to get iced back on the upstream winit personally. I'm happy to provide labor to make it happen, I just need someone to point me in a direction.

wyatt-herkamp commented 4 months ago

What is holding this feature back?

madsmtm commented 3 weeks ago

https://github.com/rust-windowing/winit/pull/3825 has been opened to resolve this, though I'm currently fairly sure that it is unnecessary, and that this feature is implement-able outside of Winit after https://github.com/rust-windowing/winit/pull/3758, see https://github.com/rust-windowing/winit/pull/3825#pullrequestreview-2231892166.