aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/launcher.c
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <ronan@rjp.ie>2022-11-18 20:05:24 -0700
committerLibravatar Simon Ser <contact@emersion.fr>2022-11-26 09:48:58 +0100
commit30ad4dc4a5a41ce7c7aa85096a6e18f374172983 (patch)
tree9b88b2c72174819ddc7f59b6cda52d28014986d7 /sway/desktop/launcher.c
parentlauncher: fudge the interface a bit (diff)
downloadsway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.tar.gz
sway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.tar.zst
sway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.zip
launcher: export xdga tokens and use them for workspace matching
Diffstat (limited to 'sway/desktop/launcher.c')
-rw-r--r--sway/desktop/launcher.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/desktop/launcher.c b/sway/desktop/launcher.c
index b983dcb0..48e5d24c 100644
--- a/sway/desktop/launcher.c
+++ b/sway/desktop/launcher.c
@@ -50,7 +50,10 @@ void launcher_ctx_consume(struct launcher_ctx *ctx) {
50 wl_list_remove(&ctx->token_destroy.link); 50 wl_list_remove(&ctx->token_destroy.link);
51 wl_list_init(&ctx->token_destroy.link); 51 wl_list_init(&ctx->token_destroy.link);
52 52
53 wlr_xdg_activation_token_v1_destroy(ctx->token); 53 if (!ctx->activated) {
54 // An unactivated token hasn't been destroyed yet
55 wlr_xdg_activation_token_v1_destroy(ctx->token);
56 }
54 ctx->token = NULL; 57 ctx->token = NULL;
55 58
56 // Prevent additional matches 59 // Prevent additional matches
@@ -201,3 +204,8 @@ struct launcher_ctx *launcher_ctx_create() {
201 wl_list_insert(&server.pending_launcher_ctxs, &ctx->link); 204 wl_list_insert(&server.pending_launcher_ctxs, &ctx->link);
202 return ctx; 205 return ctx;
203} 206}
207
208const char *launcher_ctx_get_token_name(struct launcher_ctx *ctx) {
209 const char *token = wlr_xdg_activation_token_v1_get_name(ctx->token);
210 return token;
211}