summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-22 08:40:39 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-22 08:40:39 +0200
commit586a81c7d6e02ceb5cab10e5356a8a1ff3253eda (patch)
treed8d10b9692e7685bd1341dd957fbff1f7e34bdf3 /src/app.c
parenta11c952451166920fd2c9b043a3d1b07cb24e8df (diff)
App: Attempt to open URLs using SDL first
SDL_OpenURL() was added in 2.0.14.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 4ea37cd4..e1b981d8 100644
--- a/src/app.c
+++ b/src/app.c
@@ -54,6 +54,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
54#include <SDL_render.h> 54#include <SDL_render.h>
55#include <SDL_timer.h> 55#include <SDL_timer.h>
56#include <SDL_video.h> 56#include <SDL_video.h>
57#include <SDL_misc.h>
58#include <SDL_version.h>
57 59
58#include <stdio.h> 60#include <stdio.h>
59#include <stdarg.h> 61#include <stdarg.h>
@@ -1437,6 +1439,11 @@ iBool handleCommand_App(const char *cmd) {
1437} 1439}
1438 1440
1439void openInDefaultBrowser_App(const iString *url) { 1441void openInDefaultBrowser_App(const iString *url) {
1442#if SDL_VERSION_ATLEAST(2, 0, 14)
1443 if (SDL_OpenURL(cstr_String(url)) == 0) {
1444 return;
1445 }
1446#endif
1440 iProcess *proc = new_Process(); 1447 iProcess *proc = new_Process();
1441 setArguments_Process(proc, 1448 setArguments_Process(proc,
1442#if defined (iPlatformApple) 1449#if defined (iPlatformApple)