From 99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Thu, 28 Oct 2021 17:51:44 -0700 Subject: foot/client: implement xdga client activation This is an application of the xdg activation protocol that will allow compositors to associate new foot toplevels with the command that launched them. footclient receives an activation token from the launcher which the compositor can use to track application startup. It passes the token to the foot server, which then activates the new window with the token to complete the startup sequence. --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 07f58080..851a4856 100644 --- a/main.c +++ b/main.c @@ -160,6 +160,10 @@ main(int argc, char *const *argv) static const int foot_exit_failure = -26; int ret = foot_exit_failure; + /* XDG startup notifications */ + const char *token = getenv("XDG_ACTIVATION_TOKEN"); + unsetenv("XDG_ACTIVATION_TOKEN"); + /* Startup notifications; we don't support it, but must ensure we * don't pass this on to programs launched by us */ unsetenv("DESKTOP_STARTUP_ID"); @@ -530,7 +534,8 @@ main(int argc, char *const *argv) goto out; if (!as_server && (term = term_init( - &conf, fdm, reaper, wayl, "foot", cwd, argc, argv, + &conf, fdm, reaper, wayl, "foot", cwd, token, + argc, argv, &term_shutdown_cb, &shutdown_ctx)) == NULL) { goto out; } -- cgit v1.3