mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
347e79f8a1
commit
99d5bf64bc
9 changed files with 51 additions and 11 deletions
13
server.c
13
server.c
|
|
@ -244,6 +244,17 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
|||
const char *cwd = (const char *)p; p += cdata.cwd_len;
|
||||
LOG_DBG("CWD = %.*s", cdata.cwd_len, cwd);
|
||||
|
||||
/* XDGA token */
|
||||
const char *token = NULL;
|
||||
if (cdata.xdga_token) {
|
||||
|
||||
CHECK_BUF_AND_NULL(cdata.token_len);
|
||||
token = (const char *)p; p += cdata.token_len;
|
||||
LOG_DBG("XDGA = %.*s", cdata.token_len, token);
|
||||
} else {
|
||||
LOG_DBG("No XDGA token");
|
||||
}
|
||||
|
||||
/* Overrides */
|
||||
for (uint16_t i = 0; i < cdata.override_count; i++) {
|
||||
struct client_string arg;
|
||||
|
|
@ -303,7 +314,7 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
|||
|
||||
instance->terminal = term_init(
|
||||
conf != NULL ? conf : server->conf,
|
||||
server->fdm, server->reaper, server->wayl, "footclient", cwd,
|
||||
server->fdm, server->reaper, server->wayl, "footclient", cwd, token,
|
||||
cdata.argc, argv, &term_shutdown_handler, instance);
|
||||
|
||||
if (instance->terminal == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue