From 30ad4dc4a5a41ce7c7aa85096a6e18f374172983 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Fri, 18 Nov 2022 20:05:24 -0700 Subject: launcher: export xdga tokens and use them for workspace matching --- sway/desktop/launcher.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sway/desktop') 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) { wl_list_remove(&ctx->token_destroy.link); wl_list_init(&ctx->token_destroy.link); - wlr_xdg_activation_token_v1_destroy(ctx->token); + if (!ctx->activated) { + // An unactivated token hasn't been destroyed yet + wlr_xdg_activation_token_v1_destroy(ctx->token); + } ctx->token = NULL; // Prevent additional matches @@ -201,3 +204,8 @@ struct launcher_ctx *launcher_ctx_create() { wl_list_insert(&server.pending_launcher_ctxs, &ctx->link); return ctx; } + +const char *launcher_ctx_get_token_name(struct launcher_ctx *ctx) { + const char *token = wlr_xdg_activation_token_v1_get_name(ctx->token); + return token; +} -- cgit v1.2.3