This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch improve-macos-support
in repository terminology.
View the commit online.
commit 0b876749f2f7db905c34784b5c7b416013dd8e49
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 a59c4dc9..0ec30bd2 100644
--- a/src/bin/about.c
+++ b/src/bin/about.c
@@ -39,16 +39,18 @@ _run_url(const About_Ctx *ctx,
{
char buf[PATH_MAX];
char *quoted;
-#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;
+ }
+
quoted = shell_quote(url);
if (!quoted) return;
snprintf(buf, sizeof(buf), "%s %s", cmd, quoted);
diff --git a/src/bin/media.c b/src/bin/media.c
index 948f58a7..d3211c74 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -1525,20 +1525,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 *quoted;
-#ifdef __APPLE__
- cmd = "open";
-#else
- cmd = "xdg-open";
-#endif
+
+ if (handler && *handler)
+ cmd = handler;
+
+ if (!cmd)
+ {
+ elm_open_url(src);
+ return;
+ }
quoted = shell_quote(src);
if (!quoted)
return;
- if (handler && *handler)
- cmd = handler;
snprintf(buf, sizeof(buf), "%s %s", cmd, quoted);
free(quoted);
ecore_exe_run(buf, NULL);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 2df1a49e..7f25a78a 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -787,19 +787,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;
+ }
quoted = shell_quote(p);
if (quoted)
@@ -812,12 +815,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
-
quoted = shell_quote(path);
if (quoted)
{
@@ -860,6 +857,13 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
(config->helper.local.general[0]))
cmd = config->helper.local.general;
}
+ if (!cmd)
+ {
+ free(quoted);
+ elm_open_file(path);
+ free(s);
+ goto end;
+ }
snprintf(buf, sizeof(buf), "%s %s", cmd, quoted);
}
free(quoted);
@@ -869,12 +873,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
-
quoted = shell_quote(s);
if (quoted)
{
@@ -907,6 +905,13 @@ _activate_link(Evas_Object *obj, Eina_Bool may_inline)
(config->helper.url.general[0]))
cmd = config->helper.url.general;
}
+ if (!cmd)
+ {
+ free(quoted);
+ elm_open_url(link);
+ free(s);
+ goto end;
+ }
snprintf(buf, sizeof(buf), "%s %s", cmd, quoted);
}
free(quoted);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.