From 7d1941f0c8b6680e0427b4f2bcac77d6d136a8ba Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Wed, 28 Feb 2024 14:22:09 -0700 Subject: [PATCH] xdg-activation: launcher tokens are activation requests If the launched client decides to pass it's token along as an activation request, allow that. This will make the behavior match tokens provided by an external launcher client. --- sway/xdg_activation_v1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c index b7c80dd45d..fd60487460 100644 --- a/sway/xdg_activation_v1.c +++ b/sway/xdg_activation_v1.c @@ -38,14 +38,14 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener, } // This is an activation request. If this context is internal we have ctx->seat. - struct sway_seat *seat = ctx->seat; - if (!seat) { - // Otherwise, use the seat indicated by the launcher client in set_serial - seat = ctx->token->seat ? ctx->token->seat->data : NULL; + if (ctx->seat) { + view_request_activate(view, ctx->seat); + return; } - if (seat && ctx->had_focused_surface) { - view_request_activate(view, seat); + // Otherwise, activate if passed from another focused client + if (ctx->token->seat && ctx->had_focused_surface) { + view_request_activate(view, ctx->token->seat->data); } else { // The token is valid, but cannot be used to activate a window view_request_urgent(view);