mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -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
|
|
@ -44,8 +44,11 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
|
|||
seat = ctx->token->seat ? ctx->token->seat->data : NULL;
|
||||
}
|
||||
|
||||
if (seat) {
|
||||
if (seat && ctx->had_focused_surface) {
|
||||
view_request_activate(view, seat);
|
||||
} else {
|
||||
// The token is valid, but cannot be used to activate a window
|
||||
view_request_urgent(view);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue