Skip to content

Commit

Permalink
xdg-activation: launcher tokens are activation requests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rpigott authored and emersion committed Jul 6, 2024
1 parent 3d00552 commit 28fd735
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sway/xdg_activation_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 28fd735

Please sign in to comment.