You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now please don't limit URLs to just http://. It is very common on Mac, iOS, and Android to use custom URLs to launch specific apps. Sometimes they are for popular protocols so people spontaneously conform their apps to URL schemes that get documented so their apps can handle them too, say like twitter:// (The OS may have an arbitration system if multiple apps handle the same URL scheme.) http://wiki.akosma.com/IPhone_URL_Schemes
Particularly in mobile games, I've seen a lot of developers cross-promote their apps, where one app can launch another and maybe you win points or something for doing so.
The Mac and iOS code will just work for that case. I think Windows may work too. Android is a little more involved if I remember and you may have to add more cases, but I've totally forgotten the details of how it works.
Also, there is a counterpart system to this. It is also handy to know when you've been launched via OpenURL. And you need to be able to parse the URL string for information that was passed. For example, most text editors on the Mac respond to URL schemes (even MacVim) and you can tell it to open a specific file at a specific line number. Or in the cross-promotional example above, you want to know which app launched you. The receiving app needs a notification that OpenURL was invoked with a particular string. Also, keep in mind that the app may or may not have been already running when this even happened.
On 2015-02-06 15:27:48 +0000, Sylvain wrote:
Created attachment 2021
patch SDL_OpenURL : Android + Unix
Here's a first version of "SDL_OpenURL" function for Android and Unix.
It works with URLs, and probably with directories and files.
It would be nice if someone could add MacOSX, IOS, Windows, etc.
On 2015-02-07 07:56:16 +0000, Sylvain wrote:
Created attachment 2022
patch SDL_OpenURL : Android + Unix (v2)
Update the patch so that it uses "execl()", instead of "system()", to run "xdg-open url". The argument is then protected.
Not sure if it solves the problem mentioned by Gerry JJ of browser blocking/not_blocking.
As suggested, I have updated the patch to fork twice so the application cannot be blocked.
Notice that the return code does not say anything about the success/failure of xdg-open, but now, is about the success/failure of the launcher of xdg-open.
I have used "vfork()" since it is said to be more efficient for this very case.
Update fork/vfork : use first fork(), then vfork().
Instead of "execl", use "execlp".
On 2015-05-10 22:34:37 +0000, Daniel Gibson wrote:
I think one fork() is enough. Calling setsid() before execlp() should fix the zombie-problems (if not, try a pumpgun).
On 2015-05-11 15:57:52 +0000, Daniel Gibson wrote:
ok, nevermind, setsid() doesn't seem to work like I thought it does. so probably double-fork is the way to go, even though it seems hacky to me
On 2015-05-11 16:11:10 +0000, Sylvain wrote:
There was a detailled discussion on the mailing-list about the double-fork issue and SDL_OpenURL.
And this solution was adviced.
Indeed, the code is not really readable and a cleaner solution would be better.
I don't really know about "setsid()", but post to the mailing, I sure you'll get positive feedback about it.
On 2015-06-30 13:24:37 +0000, Vikas wrote:
Created attachment 2207
patch SDL_OpenURL : Windows platform
It works with URLs,directories,files and executable.
I have tested it with windowed as well as full screen mode.
In case of full screen mode, SDL window will be minimized and browser(default) will be launched. Later on SDL window can be restored to previous state(full screen) by (ALT+TAB) or clicking the SDL app from task bar
On 2015-12-10 07:29:54 +0000, Sylvain wrote:
I have tried the patch for windows on windows 10.
The patch looks correct according to documentation but it doesn't work on my side!
On Windows 10 / x64 : it fails with error code 31 which means that "open" action and "url" are not registered together. But they are, in the register.
On Windows 10 / arm (mobile) : it compiles but app fails to start because of missing .dll ... (it should be included automatically I think).
On 2015-12-14 18:42:37 +0000, Sylvain wrote:
On windows 10, a way to open a link is:
auto uri = ref new Windows::Foundation::Uri("http://www.libsdl.org");
Windows::System::Launcher::LaunchUriAsync(uri);
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
patch SDL_OpenURL : Android + Unix (SDL_patch_OpenURL-v1.diff, text/plain, 2015-02-06 15:27:48 +0000, 6083 bytes)patch SDL_OpenURL : Android + Unix (v2) (SDL_patch_OpenURL-v2.diff, text/plain, 2015-02-07 07:56:16 +0000, 6768 bytes)patch SDL_OpenURL : Android + Unix + MacOSX + IOS (v3) (SDL_patch_OpenURL-v3.diff, text/plain, 2015-02-08 10:48:36 +0000, 7876 bytes)patch SDL_OpenURL : Android + Unix + MacOSX + IOS + double-forking (v4) (SDL_patch_OpenURL-v4.diff, text/plain, 2015-02-10 07:44:41 +0000, 8485 bytes)Reported in version: 2.0.3
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2014-11-14 14:15:58 +0000, Alexey wrote:
On 2014-11-16 14:16:58 +0000, Alex wrote:
On 2014-11-21 08:43:21 +0000, Eric wing wrote:
On 2015-02-06 15:27:48 +0000, Sylvain wrote:
On 2015-02-07 07:56:16 +0000, Sylvain wrote:
On 2015-02-08 10:48:36 +0000, Sylvain wrote:
On 2015-02-10 07:44:41 +0000, Sylvain wrote:
On 2015-02-12 07:35:12 +0000, Sylvain wrote:
On 2015-05-10 22:34:37 +0000, Daniel Gibson wrote:
On 2015-05-11 15:57:52 +0000, Daniel Gibson wrote:
On 2015-05-11 16:11:10 +0000, Sylvain wrote:
On 2015-06-30 13:24:37 +0000, Vikas wrote:
On 2015-12-10 07:29:54 +0000, Sylvain wrote:
On 2015-12-14 18:42:37 +0000, Sylvain wrote:
On 2020-10-01 12:49:52 +0000, Sylvain wrote:
On 2020-10-07 07:09:01 +0000, Sylvain wrote:
The text was updated successfully, but these errors were encountered: