Repository navigation
xdg-activation: a client's serials from before it lost focus still pass after #16427 #16606
Replies: 2 comments
|
This discussion has been automatically closed. |
0 replies
|
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the feature
Follow-up to #15692 / #16427, from the request in #13999.
#16427 rejects activation tokens whose serial isn't one of the recent serials sent to the client, and each serial works once. That stops clients that send no serial. It doesn't stop the case #13999 is mostly about: a background app raising itself.
Chromium (and Chrome, Brave) and Firefox, when another process hands them a URL with no
XDG_ACTIVATION_TOKEN, request a token themselves and set its serial to the last input event they received. That serial is still in the client's store, so on main (2860d07) the first such open after you last typed in the browser raises it, even though the browser lost focus long ago. Agents and scripts opening links hit this constantly.Proposal: also reject a token whose serial is older than the last
wl_keyboard.leavesent to the client. Input the client got while focused still works, and so do tokens another client made from fresh input and passed on (a terminal opening a link, a notification daemon on click).I wrote it on a fork, 38 lines across
SeatManager,Seat.cppandXDGActivation.cpp:https://github.com/dmkenney/Hyprland/tree/activation-reject-stale-serials (commit 1650e80, on top of main)
Tested
Nested Hyprland,
misc:focus_on_activate = true, Chromium 154 withWAYLAND_DEBUG=1, foot 1.28, quickshell sendingActivationTokenon notification click:serial 15 for activation token predates the client losing focus--xdg-activation-tokenUnvouched contributors can't open PRs, so I'm posting it here. Happy for anyone vouched to take it as-is or rework it.
Full write-up of the client side (which apps send tokens, which drop them): omacom/omarchy#16078
All reactions