aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRonan Pigott <rpigott@berkeley.edu>2021-10-29 00:51:44 +0000
committerRonan Pigott <rpigott@berkeley.edu>2021-11-01 01:52:29 +0000
commit99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8 (patch)
tree06732af5a350d8b4e8b71ba9b7ed5eef5b6115da /main.c
parentconfig: format all (well, most) error messages in the same way (diff)
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
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;
}