aboutsummaryrefslogtreecommitdiff
path: root/notify.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-05-03 17:37:04 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-05-05 08:02:28 +0000
commitea1aac88db3a6d9f368406676c3e5a0cedcafd57 (patch)
tree7af0f1131052ec40c4ecda6a2f81694a8c26af05 /notify.c
parentchangelog: fix URL in #1047 issue link (diff)
url-mode: add support for XDG activation when opening URLs
First, add a ‘token’ argument to spawn(). When non-NULL, spawn() will set the ‘XDG_ACTIVATION_TOKEN’ environment variable in the forked process. If DISPLAY is non-NULL, we also set DESKTOP_STARTUP_ID, for compatibility with X11 applications. Note that failing to set either of these environment variables are considered non-fatal - i.e. we ignore failures. Next, add a helper function, wayl_get_activation_token(), to generate an XDG activation token, and call a user-provided callback when it’s ‘done (since token generation is asynchronous). This function takes an optional ‘seat’ and ‘serial’ arguments - when both are non-NULL/zero, we set the serial on the token. ‘win’ is a required argument, used to set the surface on the token. Re-write wayl_win_set_urgent() to use the new helper function. Finally, rewrite activate_url() to first try to get an activation token (and spawn the URL launcher in the token callback). If that fails, or if we don’t have XDG activation support, spawn the URL launcher immediately (like before this patch). Closes #1058
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/notify.c b/notify.c
index 13cee895..8180477d 100644
--- a/notify.c
+++ b/notify.c
@@ -48,7 +48,7 @@ notify_notify(const struct terminal *term, const char *title, const char *body)
/* Redirect stdin to /dev/null, but ignore failure to open */
int devnull = open("/dev/null", O_RDONLY);
- spawn(term->reaper, NULL, argv, devnull, -1, -1);
+ spawn(term->reaper, NULL, argv, devnull, -1, -1, NULL);
if (devnull >= 0)
close(devnull);