mirror of
https://github.com/swaywm/sway.git
synced 2026-03-13 05:34:04 -04:00
xdg-activation: distinguish activation and urgency requests
Check if the app that requested a token has provided a valid input serial and a focused surface. Downgrade activation request to urgency otherwise. This is mostly in line with what other Wayland compositors decided to do, and offers a better security than the original logic.
This commit is contained in:
parent
f6d22f8e68
commit
d19810eba8
5 changed files with 18 additions and 1 deletions
|
|
@ -216,6 +216,8 @@ struct launcher_ctx *launcher_ctx_create(struct wlr_xdg_activation_token_v1 *tok
|
|||
ctx->fallback_name = strdup(fallback_name);
|
||||
ctx->token = token;
|
||||
ctx->node = node;
|
||||
// Having surface set means that the focus check in wlroots has passed
|
||||
ctx->had_focused_surface = token->surface != NULL;
|
||||
|
||||
ctx->node_destroy.notify = ctx_handle_node_destroy;
|
||||
wl_signal_add(&ctx->node->events.destroy, &ctx->node_destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue