This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/35/head
in repository terminology.

View the commit online.

commit 76dc1890b251b30c132e76f92463fbb77593cf30
Author: Cedric BAIL <[email protected]>
AuthorDate: Thu Apr 30 11:42:59 2026 -0600

    macos: replace xdg-open/open ifdefs with portable elm_open_* calls
    
    media.c, about.c, and termio.c each had #ifdef __APPLE__ blocks
    selecting between 'xdg-open'/'xdg-email' (Linux) and 'open' (macOS)
    for the fallback when the user hadn't configured a custom helper.
    All five sites now route to elm_open_url / elm_open_file /
    elm_open_email when no user override is set.
    
    User-configured helpers (config.helper.url.general etc.) still take
    precedence — the fallback only applies when those are empty.
---
 src/bin/about.c  | 12 +++++++-----
 src/bin/media.c  | 18 ++++++++++--------
 src/bin/termio.c | 45 +++++++++++++++++++++++++--------------------
 3 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/src/bin/about.c b/src/bin/about.c
index 7216790b..50cb455c 100644
--- a/src/bin/about.c
+++ b/src/bin/about.c
@@ -36,16 +36,18 @@ _run_url(const About_Ctx *ctx,
          const char *url)
 {
    char buf[PATH_MAX];
-#ifdef __APPLE__
-   const char *cmd = "open";
-#else
-   const char *cmd = "xdg-open";
-#endif
+   const char *cmd = NULL;
 
    if (ctx->config && ctx->config->helper.url.general &&
        ctx->config->helper.url.general[0])
      cmd = ctx->config->helper.url.general;
 
+   if (!cmd)
+     {
+        elm_open_url(url);
+        return;
+     }
+
    snprintf(buf, sizeof(buf), "%s %s", cmd, url);
    ecore_exe_run(buf, NULL);
 }
diff --git a/src/bin/media.c b/src/bin/media.c
index 3fd5200e..214687db 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -1524,20 +1524,22 @@ media_control_get(const Evas_Object *obj)
 void
 media_unknown_handle(const char *handler, const char *src)
 {
-   const char *cmd;
+   const char *cmd = NULL;
    char buf[PATH_MAX];
    char *escaped;
-#ifdef __APPLE__
-   cmd = "open";
-#else
-   cmd = "xdg-open";
-#endif
+
+   if (handler && *handler)
+     cmd = handler;
+
+   if (!cmd)
+     {
+        elm_open_url(src);
+        return;
+     }
 
    escaped = ecore_file_escape_name(src);
    if (!escaped)
      return;
-   if (handler && *handler)
-     cmd = handler;
    snprintf(buf, sizeof(buf), "%s %s", cmd, escaped);
    free(escaped);
    ecore_exe_run(buf, NULL);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 20359917..59523cda 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -779,19 +779,22 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
      {
         const char *p = s;
 
-        // run mail client
-#ifdef __APPLE__
-        cmd = "open";
-#else
-        cmd = "xdg-email";
-#endif
+        if (casestartswith(s, "mailto:"))
+          p += sizeof("mailto:") - 1;
 
         if ((config->helper.email) &&
             (config->helper.email[0]))
           cmd = config->helper.email;
 
-        if (casestartswith(s, "mailto:"))
-          p += sizeof("mailto:") - 1;
+        if (!cmd)
+          {
+             const char *email_addr = link;
+             if (casestartswith(link, "mailto:"))
+               email_addr += sizeof("mailto:") - 1;
+             elm_open_email(email_addr);
+             free(s);
+             goto end;
+          }
 
         escaped = ecore_file_escape_name(p);
         if (escaped)
@@ -803,12 +806,6 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
    else if (path)
      {
         // locally accessible file
-#ifdef __APPLE__
-        cmd = "open";
-#else
-        cmd = "xdg-open";
-#endif
-
         escaped = ecore_file_escape_name(path);
         if (escaped)
           {
@@ -851,6 +848,13 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
                            (config->helper.local.general[0]))
                          cmd = config->helper.local.general;
                     }
+                  if (!cmd)
+                    {
+                       free(escaped);
+                       elm_open_file(path);
+                       free(s);
+                       goto end;
+                    }
                   snprintf(buf, sizeof(buf), "%s %s", cmd, escaped);
                   free(escaped);
                }
@@ -859,12 +863,6 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
    else if (url)
      {
         // remote file needs ecore-con-url
-#ifdef __APPLE__
-        cmd = "open";
-#else
-        cmd = "xdg-open";
-#endif
-
         escaped = ecore_file_escape_name(s);
         if (escaped)
           {
@@ -897,6 +895,13 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
                            (config->helper.url.general[0]))
                          cmd = config->helper.url.general;
                     }
+                  if (!cmd)
+                    {
+                       free(escaped);
+                       elm_open_url(link);
+                       free(s);
+                       goto end;
+                    }
                   snprintf(buf, sizeof(buf), "%s %s", cmd, escaped);
                   free(escaped);
                }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to