aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2024-02-28 14:22:09 -0700
committerSimon Ser <contact@emersion.fr>2024-07-06 16:12:27 +0200
commit28fd73589df0e73e1d15e165acd90651a5f805d6 (patch)
tree7c265a09ebf7ac7f4bda0786f5267bf1d35ef2a2
parent3d0055203583d576ec1dec5a22f25ddf9a53b8ec (diff)
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.
-rw-r--r--sway/xdg_activation_v1.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c
index b7c80dd4..fd604874 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);