Repository navigation
Replies: 5 comments
|
Progress:
|
0 replies
Status: merge order and test resultsAll PRs and upstream threads are listed in the table at the top. Omarchy (merge in this order)
Independent: omacom/omarchy-pkgs#1374 (Ghostty 1.3.1 passes a token to Why the order matters: #16427 alone already breaks the Apps launcher for running apps. Tested since the write-up
After it ships#14283's browser opt-out and |
0 replies
|
Update on quickshell:
|
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
Quickshell.activationToken()Quickshell.activationToken()(draft, on top of #1351)focus_on_activatewindow rule is a no-op; it does take effect on 0.56.2The problem
When a script, an agent or another app opens a link, the browser asks Hyprland for focus and the view jumps to the browser's workspace (#14282). Omarchy sets
misc:focus_on_activate = true, so every request is granted.Turning that off is not a fix either. Clicking a notification raises the sender through the same request, so with it off a Teams or Slack toast click only closes the toast.
The open PRs work around this per app:
focus_on_activateoff for browser classes.urgentevent Hyprland emits when it denies a request, and focuses that window after a toast click.I ran #14283 with a port of #7738 and it works. But Hyprland can't tell a click from an automated open, so the rules have to guess per app. Wayland already has the signal that tells them apart, and right now it gets dropped or ignored.
How Wayland is meant to handle it
xdg-activation-v1tokens carry the serial of the input event that caused them. When you click a link, the app you clicked in asks for a token with that click's serial and passes it on (XDG_ACTIVATION_TOKEN). The app that receives it uses the token to request focus. The compositor can then grant focus when the serial is from a recent real input, and only mark the window urgent when it isn't. GNOME and KDE use this to stop windows from stealing focus.What I tested
Omarchy
quattroplus #14283, Hyprland 0.56.2, quickshell with omacom/omarchy-pkgs#1367, Brave 1.97, Chromium 154, Chrome 155, Firefox 158, foot 1.28, Alacritty 0.17, Ghostty 1.3.1. I logged the apps' Wayland traffic withWAYLAND_DEBUG=1and Hyprland'surgentevents.Who sends a token with a real serial
Ctrl+Shift+O)What browsers do when handed a URL
XDG_ACTIVATION_TOKENor--xdg-activation-tokenOmarchy drops the token
omarchy-cmd-browser-handoffwrites the URL straight to Chromium's singleton socket and doesn't pass the token. Adding--xdg-activation-token=$XDG_ACTIVATION_TOKENto the argv works: Chromium, Chrome and Brave all activated with the token they were given.omarchy-launch-browserandomarchy-launch-webappstart a browser throughsystemd-run, which doesn't pass the caller's environment.XDG_ACTIVATION_TOKENnever arrives.--setenv=XDG_ACTIVATION_TOKENfixes it.So a link you open in foot reaches the browser without proof of the click, and the browser makes its own token with an old serial.
Hyprland is fixing half of it
Hyprland 0.56.2 stores the serial and never checks it. hyprwm/Hyprland#16427 (merged Sep 30, not released) now rejects a token unless its serial is one of the last 100 sent to that client, and each serial works only once.
I built Hyprland main (2860d07b) and ran it nested with
focus_on_activate = true:So once #16427 ships, the first automated open after you last used the browser still takes focus. Repeats are blocked.
To close the gap I wrote a follow-up on a fork: dmkenney/Hyprland@activation-reject-stale-serials. It records the serial of the last
wl_keyboard.leavesent to each client and rejects activation tokens with an older serial. Same nested test:hyprwm only takes PRs from vouched contributors, so this needs someone who is vouched to pick it up, or a nod from the Hyprland side.
Proposed changes
Hyprland
Omarchy
3.
omarchy-cmd-browser-handoff: pass--xdg-activation-token.4.
omarchy-launch-browser/omarchy-launch-webapp:systemd-run --setenv=XDG_ACTIVATION_TOKEN.5. Once Hyprland ships 1, drop the per-app
focus_on_activaterules (#14283's browser rule,apps/telegram.lua) and keepfocus_on_activate = true. Valid tokens get focus; everything else gets marked urgent.quickshell
6. omacom/omarchy-pkgs#1367 patches quickshell to send a token with notification actions. Upstream, this goes on top of quickshell-mirror/quickshell#1166 once it merges.
Terminals
7. Ghostty and Alacritty: request a token with the click serial when opening a link, like foot does.
Browsers
8. Chromium and Firefox: don't attach the last input serial to a focus request no input caused. With 1 in place this matters less, but it's the root of the stale-serial case.
3, 4 and 6 help now and fit the end state. 7 and 8 are independent. 5 waits for 1.
Existing PRs and issues
focus_on_activatewindow rule is a no-op. In my tests on 0.56.2 it did take effect: with the global option on, Brave's requests were denied and its windows marked urgent.Scope
Every result above comes from the apps and versions listed. Apps outside the tables weren't tested.
Feedback on the direction is welcome before I open the PRs.
All reactions