Skip to content

Keep browsers from taking focus on activation requests - #14283

Open
kouyichi wants to merge 7 commits into
omacom:quattrofrom
kouyichi:focus-on-activate-browsers
Open

kouyichi wants to merge 7 commits into
omacom:quattrofrom
kouyichi:focus-on-activate-browsers

Conversation

@kouyichi

@kouyichi kouyichi commented Oct 4, 2026 •

Copy link
Copy Markdown

What

Both browser families stop accepting activation requests, the way Telegram already does (default/hypr/apps/telegram.lua):

o.window("^((google-)?[cC]hrom(e|ium)(-browser|-stable|-beta|-dev|-unstable)?|[bB]rave-browser(-beta|-dev|-nightly)?|[mM]icrosoft-edge(-beta|-dev)?|Vivaldi-stable|Vivaldi-snapshot|helium)$", { focus_on_activate = false })
o.window("^(([fF]irefox)(-developer-edition)?|zen|librewolf)$", { focus_on_activate = false })

The property sits on its own class rule rather than the tagging one, so the opt-out can name the classes the browsers actually report (Chromium, chromium-browser, Chrome's -stable/-beta/-dev/-unstable, Brave's -beta/-dev/-nightly, Edge's -beta/-dev, Vivaldi's -snapshot) while the family tags keep their unscoped patterns — apps/pip.lua and the video rules key off those tags for web apps, and an Omarchy web app's class (chrome-<host>_<path>-Default) spells none of the browser names, so web apps keep their activation requests.

bin/omarchy-launch-browser also stops focusing a browser it handed a URL to; only a browser the launcher started itself is focused.

Why

Omarchy turns misc:focus_on_activate on globally (default/hypr/looknfeel.lua:111) while Hyprland defaults it off, so any client that asks to be focused gets the keyboard and the active workspace moves to wherever its window lives. For a single-instance browser handed a URL by another process that is not what the user asked for:

$ hyprctl activeworkspace -j      # before -> 2, terminal focused
$ chromium "https://example.com/"
正在现有的浏览器会话中打开。
$ hyprctl activeworkspace -j      # after  -> 3, view jumped, no user input

The link still opens in the browser window that owns the session; the view just stays where the user is. Background is #14282.

Known cost: browser-sent notification clicks

The global default stays untouched, but this opt-out is not free. Clicking a Teams or Slack toast that a browser tab sent runs the notification's default action, and the only thing that raises the window is the browser's own activation request — which this rule suppresses. shell/plugins/notifications/Service.qml only falls back to focusing the sender by class when no action was invoked, so such a click would close the toast and nothing else would come up.

A per-window rule cannot separate that request from the URL handoff this PR exists to stop: both are the same client asking to be raised, so the opt-out is either on or off for the class. The lane that gives the click its raise back is #7738 — focus the window the request named instead of relying on misc:focus_on_activate. Until that lands, this rule trades a notification click that does not raise for a URL handoff that does not jump; the rule's comment says so explicitly.

Tests

test/shell.d/hyprland-browser-focus-test.sh loads the app rules with a stub hl and asserts, per emitted rule, that every browser class is opted out, that the Chromium web-app class is not, and that a focus_on_activate = true probe is not counted as an opt-out: 5 ok.

test/shell.d/launch-browser-test.sh covers the launcher, including the handoff case with HYPRLAND_INSTANCE_SIGNATURE set, and asserts nothing is focused: 5 ok. Both run with the repo's bin on PATH.

  • Fails on quattro before the change (new test file run against 492b8837): not ok - the browser rules opt out of activation requests
  • luac -p default/hypr/apps/browser.lua clean
  • Registered the same rule tables through a live hyprctl eval on Hyprland 0.56.2: accepted, hyprctl configerrors empty, focused window and client list unchanged
  • bash test/shell: 382 of 399 files pass; the 17 failing ones fail identically on a clean upstream/quattro checkout in this environment and none touch this PR's files

Status

Held at 973cee8 until the direction is settled. The measurement this PR cannot make from here — a notification click raised by the browser itself — is in the write-up in #16078, which proposes letting activation-token serials decide instead of per-app rules, once Hyprland accepts them (hyprwm/Hyprland#16606, unreleased). Agreed with @dmkenney: the browser rule stays while it is the only thing that stops the handoff jump, and comes out as a two-line revert once the token check ships; the launcher half stands alone either way.

#16079 passes the activation token through the same two launch paths this PR touches. The hunks are independent (--setenv=XDG_ACTIVATION_TOKEN on the systemd-run unit vs. the started_browser focus guard), so either order merges mechanically.

Note on #15661: the focus_on_activate window rule is not inert on the released compositor — in the v0.56.2 tag it is a recognised rule effect (WindowRuleEffectContainer.cpp:46) that overrides the global misc:focus_on_activate per window (Window.cpp:1375). Reasoning in my comment there.


Disclosure: this patch was prepared with an AI coding agent (Hermes) at my direction; I reviewed the diff and ran the checks above myself.

Omarchy sets misc:focus_on_activate globally, so a running single-instance
browser that is handed a URL by another process activates the window that owns
the session and the view jumps to whichever workspace that window lives on.
Telegram already opts out per app; do the same for both browser families.

A new shell test loads the app rules with a stub hl and asserts both families
decline activation requests.

Refs omacom#14282
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with the stated notification-click tradeoff.

Summary

Stops browser activation requests from taking focus and skips explicit focus after a successful URL handoff.

  • Running browser windows stop pulling the view to their workspace on activation requests.
  • Handed-off URLs no longer trigger an explicit browser focus.

Reviews (5) · Last reviewed commit: "test: drop the browser rule config test" · Reviewed by Greptile

Comment thread default/hypr/apps/browser.lua Resolved
@CaffeinatedTech

Copy link
Copy Markdown

Especially good when you have an AI agent opening up chrome browser tabs while you are off on a different workspace doing something else.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 95800c790cc2c4c8f4408b5ea2e4d340596a5c7c.

Reviewed both browser-family rules and their interaction with the tag rules. The Lua rule test passed with a stub compositor API. This disables browser activation requests; the separate explicit focus in omarchy-launch-browser remains outside this rule. No new rule defect found. A live browser/link-opening session was not exercised.

@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for this. Stopping a link handoff from yanking the workspace is a real improvement. I think there are two things to sort out before it lands, though:

  1. Notification clicks for browsers and web apps. The Chromium regex isn't anchored, so it also matches Omarchy web apps (chrome-<host>__-Default). When you click a Chrome or web-app notification, Service.qml calls the notification's default action. Then invoked = true, so it skips the omarchy-hyprland-focus-app fallback, and the app's own activation request is the only thing that would raise the window. With focus_on_activate = false on that class, clicking a Gmail/HEY/Slack web-app notification would probably do nothing visible anymore. Could you check that on a live session? If it reproduces, one option is to keep the focusApp(entry) fallback running after invoke() when the sender is a browser or web app, rather than only when nothing was invoked (or something like Notifications: clicking a toast focuses the exact sending window when focus_on_activate is off #7738, which focuses the exact sending window).

  2. omarchy-launch-browser still focuses explicitly, as Greptile pointed out. So the xdg-open / link-click path may keep jumping workspaces even with this rule. It would help to say in the PR which entry points this actually fixes, or to drop that focus call for the "URL handed to an existing session" case.

Related: #14282 (the global default), #7738, #7369, #7957.

…anded-off URL

Review follow-up on omacom#14283:

- The unanchored Chromium pattern also catches an Omarchy web app's window
  class (chrome-<host>_<path>-Default, omarchy-webapp-window-class). Clicking
  such a web app's notification runs the notification's default action, and the
  shell only falls back to raising the sender by class when nothing was invoked
  (shell/plugins/notifications/Service.qml) -- so an opt-out covering those
  classes makes the click do nothing visible. Name the browser classes instead,
  with the release suffixes they ship under (chromium-browser on the same
  machine as chromium, google-chrome-stable/-beta/-dev/-unstable). The tag
  patterns stay unscoped, because apps/pip.lua and the video rules key off them
  for web apps.
- omarchy-launch-browser focused the browser for any launch that carried a URL,
  which is the handoff path a link click takes when the browser is already
  running: focusing there defeats the opt-out. Focus only a browser this
  launcher started.

Tests: test/shell.d/hyprland-browser-focus-test.sh (4 ok) and
test/shell.d/launch-browser-test.sh (3 ok, incl. the new handoff case).
@kouyichi

Copy link
Copy Markdown
Author

Both points addressed in 2e0e8b8 (plain commit, no force-push).

1. Web apps and their notification clicks. You are right that the Chromium pattern was unanchored — it matched chrome-<host>_<path>-Default, the class omarchy-webapp-window-class gives a web app's window (on a live session here: omarchy-webapp-window-class https://web.whatsapp.com/ → chrome-web.whatsapp.com__-Default). So the opt-out now names the classes the browsers report instead of a substring of them:

o.window("^((google-)?[cC]hrom(e|ium)(-browser|-stable|-beta|-dev|-unstable)?|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium)$", { focus_on_activate = false })
o.window("^(([fF]irefox)(-developer-edition)?|zen|librewolf)$", { focus_on_activate = false })

The suffixes are the names the Chromium releases actually ship under — a live session here has both chromium and chromium-browser windows up at the same time, and Chrome's channels are google-chrome-stable/-beta/-dev/-unstable. The web app class can spell none of them, so those windows keep the activation request the notification path needs, and no change to Service.qml is needed. (Happy to go the other way — keep the pattern unscoped and keep focusApp(entry) running after invoke() for browser/web-app senders — if you would rather have the rule cover web apps and the shell carry the fallback.)

The tag patterns stay unscoped on purpose: apps/pip.lua and the video rule below it float web apps by adding/dropping chromium-based-browser, so narrowing those would change web-app behaviour beyond this fix.

2. Which entry points this actually fixes. omarchy-launch-browser was focusing for any launch that carried a URL, including the handoff path a link click takes when the browser is already running — focusing there defeats the rule. It now focuses only a browser it started itself:

  • xdg-open / link clicks / omarchy-launch-browser <url> → handed to the running browser: fixed, no focus, the view stays where it is.
  • The same called with no browser running: still starts one and still focuses it, as before.
  • omarchy-launch-webapp execs the browser directly and never focused.
  • omarchy-launch-or-focus-webapp keeps its explicit focus — that path asks for it by name.

Tests. test/shell.d/hyprland-browser-focus-test.sh now asserts per emitted rule that the browsers match and the web-app class does not, and that web apps still carry the tag: 4 ok. test/shell.d/launch-browser-test.sh gained the handoff case with HYPRLAND_INSTANCE_SIGNATURE set and asserts nothing is focused: 3 ok. Both run with the repo's bin on PATH.

I could not exercise a real notification click on a web app — the web apps on this machine carry custom --class names, so nothing here reproduces chrome-<host>_<path>-Default. The rule no longer covering that class is what the test pins; if you want the click path verified end to end on a live session before this lands, I would rather say so than claim it.

Also checked the merge against current quattro for the launcher: upstream's newer private-flag code and this change 3-way-merge with no conflict (verified with git merge-file against quattro's version of the file).

Comment thread default/hypr/apps/browser.lua Resolved
…t-out

The anchored opt-out named the classes the stable packages report, but Brave and
Edge ship every channel as its own package with its own window class
(brave-browser-beta, microsoft-edge-dev, ...). The family tag catches those
windows, so the opt-out has to as well -- otherwise a link handed to a running
Beta still asks to be focused and drags the view to its workspace, which is the
behaviour this rule exists to stop. Vivaldi's snapshot builds are the same case.

The test now also proves it reads the value rather than the key: a rule that opts
back in is asserted not to count as an opt-out. The previous
`focus_on_activate ~= nil` classification would have called that rule an opt-out
and let a `true` value pass.
…e-browsers

# Conflicts:
#	test/shell.d/launch-browser-test.sh
@kouyichi

Copy link
Copy Markdown
Author

Both review points are now actually covered, and the branch is merged up to quattro. My earlier "both points addressed" note was wrong about the second one — the test still keyed on the key's presence — so it is fixed here for real.

Channel builds opt out too (6332185f). The anchored rule named the classes the stable packages report, so brave-browser-beta, microsoft-edge-dev and Vivaldi-snapshot picked up the family tag but not the opt-out — a link handed to a running Beta still asked to be focused and moved the view to its workspace, which is the behaviour this rule exists to stop. Brave's -beta/-dev/-nightly, Edge's -beta/-dev and Vivaldi's -snapshot are now in the pattern, and test/shell.d/hyprland-browser-focus-test.sh asserts each of them, plus that the Chromium web-app class still does not match.

The test reads the value, not the key (second hunk of 6332185f). It now classifies on focus_on_activate == false. To make that guard real rather than aspirational, the Lua block registers a probe rule with focus_on_activate = true and the shell side asserts it is not counted as an opt-out: under the previous ~= nil check that assertion fails, so a future true cannot pass unnoticed.

Merged up to quattro (8d850424, merge of 492b8837). One conflict, in test/shell.d/launch-browser-test.sh: upstream added its --private flag-probing tests exactly where this PR adds the handoff-focus assertion, so both are kept. bin/omarchy-launch-browser auto-merged correctly — upstream's --private probe and this PR's started_browser focus guard now coexist.

Verification on the merged head:

  • test/shell.d/launch-browser-test.sh and test/shell.d/hyprland-browser-focus-test.sh pass.
  • bash test/shell: 382 of 399 files pass. All 17 failing files fail identically on a clean upstream/quattro checkout in this environment, and none of them touch this PR's files (hermes-cli, omasnap, webapp-install, ...).

@WonkaRed

Copy link
Copy Markdown

@CaffeinatedTech's comment above describes the agent case, a browser opening tabs while you work on another workspace. On Hyprland 0.56.2 I found that with the option off, new windows and Browser.setWindowBounds going fullscreen still take focus, so I added a rule for agent-driven browsers: #15750. It complements this PR rather than replacing it.

@kouyichi

Copy link
Copy Markdown
Author

Thanks — that matches the split in the code. This PR only sets focus_on_activate = false on the anchored browser classes; it does not touch new-window focus or fullscreen requests at all, so an agent-driven browser opening tabs or going fullscreen needs its own lane and #15750 is that lane.

Two details that keep the two rules from overlapping, for the record:

  • The opt-out here is class-anchored (^((google-)?[cC]hrom(e|ium)(-browser|-stable|-beta|-dev|-unstable)?|brave-browser(-beta|-dev|-nightly)?|microsoft-edge(-beta|-dev)?|Vivaldi-stable|Vivaldi-snapshot|helium)$ and the Firefox family). A browser started with --class=agent-<name> reports that class instead, so it never matches this rule.
  • In the other direction, agent-.* cannot match a default browser class, so the agent rule does not catch ordinary browser windows either.

I have not reproduced the new-window / Browser.setWindowBounds behaviour on 0.56.2 myself, so I am not vouching for that half — only noting that this PR cannot be expected to fix it, and that the two patches are disjoint rather than conflicting.

Head 8d850424 still passes both rule tests here: test/shell.d/hyprland-browser-focus-test.sh 5 ok, test/shell.d/launch-browser-test.sh 5 ok.

@dmkenney

dmkenney commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

This also blocks notification clicks from the browser itself, not only from web apps.

Teams, Slack and other web clients send notifications from a service worker. On click the shell invokes the default action, the browser runs client.focus(), and the window is raised through an xdg-activation request. That request is the only thing that can raise the right window: the notification doesn't say which browser window sent it, so the shell's focusApp fallback can't pick it, and it is skipped anyway once an action was invoked.

Quickshell never sent the activation token those requests need, so this path was already broken. omacom/omarchy-pkgs#1367 patches quickshell to send it. With that build, clicking a real Teams notification in Brave from another workspace switches to the Teams window that sent it, even with two Teams windows open. With focus_on_activate = false on brave-browser, Hyprland would ignore that request again and the click would only close the toast.

Could the link-handoff jump be fixed without turning off activation for the whole browser class?

Clicking a Teams or Slack toast from a browser tab runs the notification's
default action, and the window is raised only by the browser's activation
request, which this rule suppresses. No per-window switch separates that
request from the URL handoff the rule exists to stop, so name the lane that
gives the click its raise back (omacom#7738) in the rule's own comment.
@kouyichi

Copy link
Copy Markdown
Author

You are right, and it is not limited to web apps — the browser's own notifications sit on the same switch.

shell/plugins/notifications/Service.qml::invokePopupDefault runs the sender's default action and only falls back to focusApp(entry) when nothing was invoked, so for a Teams/Slack toast sent by a page in a browser tab the raise is the browser's client.focus() → xdg-activation request and nothing else. With focus_on_activate = false on that class Hyprland ignores it and the click only closes the toast, as you describe. I cannot reproduce the click here (no service-worker client on this box), so that half rests on your live session plus the code path, not on my own measurement.

Could the handoff jump be fixed without turning activation off for the whole class? Not with a window rule. The URL handoff and the notification click are both an xdg-activation request from the same client — the repro in this body jumps from a bare chromium <url> in a terminal, with no Omarchy launcher in the path, which is what makes it the browser's own request — and focus_on_activate is a per-window property, so the class pattern cannot separate one request from the other. Narrowing it further means giving up the case this PR exists for.

What each half actually buys:

  • The rule is the half that stops the jump. bin/omarchy-launch-browser no longer focuses a browser it handed a URL to, but that removes a second, redundant raise; the browser asks for activation itself either way.
  • Anchoring the pattern (2e0e8b8) keeps web-app classes out of the opt-out, which is what @jandrusk's web-app notification case needed. A browser-tab notification has no equivalent escape, because the window is the browser.

The lane that composes with it is #7738: focus the window the activation request named instead of relying on misc:focus_on_activate to raise it. Hyprland marks that window urgent when it denies the request — that is the event #7738 builds on — so a toast-click listener can raise the exact window, which also covers the two-windows case your focusApp note is about.

I have written that cost into the rule's own comment (973cee8) rather than leave the file claiming the web-app case is the only one, and the PR body now carries the same paragraph.

I would rather not land this as a silent regression against omarchy-pkgs#1367, so which way do you and the maintainers want it:

  1. keep the opt-out and take the dependency on Notifications: clicking a toast focuses the exact sending window when focus_on_activate is off #7738 for browser-sent notification clicks, or
  2. drop the rule and keep only the launcher change — which removes the double raise but not the jump, leaving misc:focus_on_activate = true (shipped default) lets any activate request switch the active workspace — Hyprland defaults this to false #14282 open.

Head is 973cee8. test/shell.d/hyprland-browser-focus-test.sh 5 ok, test/shell.d/launch-browser-test.sh 5 ok, and the rule test answers not ok - the browser rules opt out of activation requests against quattro @492b8837 before the change.

@dmkenney

Copy link
Copy Markdown
Contributor

Thanks. I tested this with a port of #7738 and it works: links stay put, notification clicks jump to the right window. While testing I found that Wayland activation tokens can tell a real click from an automated open, and that Omarchy and Hyprland currently drop or ignore that signal. Hyprland already merged part of a fix (hyprwm/Hyprland#16427, unreleased). I'm finishing a few tests and will open a discussion with the full picture soon. It may replace the browser rule here, so it might be worth holding off on further changes until then.

@kouyichi

Copy link
Copy Markdown
Author

Thank you — that is the measurement I could not make here (no service-worker client on this box), and it changes what this PR should be. Holding as you suggest: no new commits, head stays at 973cee8.

So the discussion starts from the branch rather than from my summary:

  • The rule half is focus_on_activate = false on the anchored browser classes (Chromium/Chrome stable/beta/dev/unstable, Brave incl. -beta/-dev/-nightly, Edge incl. -beta/-dev, Vivaldi-stable/Vivaldi-snapshot, and the Firefox family). It is class-wide by construction: Hyprland applies the property per window, so it cannot tell a click-driven activation from an automated one. That is exactly the distinction you say the token carries.
  • The launcher half is bin/omarchy-launch-browser not focusing a browser it just handed a URL to. It removes a redundant raise and stays correct under any request-side fix, so it is the half I would keep if the rule goes.
  • With the rule dropped and no request-side lane, the URL handoff jump in misc:focus_on_activate = true (shipped default) lets any activate request switch the active workspace — Hyprland defaults this to false #14282 comes back, since the browser issues its own activation request either way. Nothing here touches new-window focus or fullscreen (Browser.setWindowBounds) — that stays Keep agent-driven browsers from taking the keyboard #15750's lane.

If the token approach replaces the rule, say the word and I will reduce this PR to the launcher change plus its test (or close it and fold everything into the discussion's patch, if that is cleaner for the maintainers). A ping when the discussion is up would be enough; I will not push to this branch before then.

@dmkenney

Copy link
Copy Markdown
Contributor

Full write-up with test results and the proposed fixes: #16078

@kouyichi

Copy link
Copy Markdown
Author

Read the write-up in #16078 — thank you, that is the picture I could not assemble here. No commits from my side: head stays 973cee8, as agreed.

Item 5 is exactly what this branch can give you. The rule is here today, and once Hyprland ships the stricter serial check (#16606) it comes out cleanly — dropping it would be a two-line revert (the two o.window opt-outs plus their assertions in test/shell.d/hyprland-browser-focus-test.sh). The launcher half — omarchy-launch-browser not focusing a browser it just handed a URL to — stands on its own in every end state you list.

Two notes.

#15661's "the focus_on_activate window rule is a no-op (also affects #14283)" does not hold on 0.56.2. I checked the released tag rather than the binary, because the rule name is snake case and strings | grep -ci focusonactivate cannot match it:

  • src/desktop/rule/windowRule/WindowRuleEffectContainer.cpp:46 lists "focus_on_activate" in the window-rule effect table.
  • src/config/lua/bindings/LuaBindingsInternal.hpp:84 binds the Lua key to WINDOW_RULE_EFFECT_FOCUS_ON_ACTIVATE, so hl.window_rule({ focus_on_activate = false }) is a recognised property rather than a silently-dropped key.
  • src/desktop/view/Window.cpp:1375 decides focus on m_ruleApplicator->focusOnActivate().valueOr(*misc:focus_on_activate) — the per-window value overrides the global option, which is the mechanism this PR relies on.
  • src/debug/HyprCtl.cpp:1585 exposes hyprctl getprop <address> focus_on_activate, so it can be read back per window if anyone wants to re-verify.

That agrees with your live measurement (requests denied, windows marked urgent). The remaining weakness on my side is unchanged: our test pins rule registration, so the behavioural evidence is yours, not mine. If the rule does turn out inert on some build, this PR collapses to the launcher half and #14282 goes back to open — say the word and I will cut it.

Overlap with #16079. It touches bin/omarchy-launch-browser and test/shell.d/launch-browser-test.sh, the same two files as this PR's launcher half. The hunks do not fight: its --setenv=XDG_ACTIVATION_TOKEN rides the systemd-run unit, this PR's started_browser guard decides whether to focus afterwards, and each adds one case to the same test file. Whichever lands second takes a mechanical merge — if #16079 goes in first, ping me and I will merge quattro and keep both.

@dmkenney

Copy link
Copy Markdown
Contributor

Correction to the link above: the Hyprland side is hyprwm/Hyprland#16608 (#16606 was closed for using the wrong form). Omarchy carries the patch in omacom/omarchy-pkgs#1379 meanwhile, so the browser rule here can come out once #1379, #16097 and omacom/omarchy-pkgs#1367 ship. Status and merge order: #16078 (comment)

@kouyichi

Copy link
Copy Markdown
Author

Thanks — corrected in my notes, and the gate you name is still closed, so nothing changes on the branch: head stays at 973cee8.

Checked on the public side just now:

So the rule stays in this PR as the interim measure until #1367, #16097 and #1379 all ship. When they do it comes out exactly as described earlier: the two o.window opt-outs plus their assertions in test/shell.d/hyprland-browser-focus-test.sh, leaving the launcher half and its test. Say the word at that point and I will cut it here rather than you folding it into the discussion's patch.

One thing about the corrected link, so readers of #16078 do not hit it: hyprwm/Hyprland#16606, #16607 and #16608 all answer 404 right now (gh api repos/hyprwm/Hyprland/issues/16608 → Not Found, while the neighbouring numbers 16605/16609 resolve normally), and gh pr list --author dmkenney on that repo returns nothing, while your fork branch activation-reject-stale-serials does exist at 1650e80. If the PR is still local or was closed as a draft, the write-up's upstream bullet may want the fork branch link instead. Nothing I need from you — just flagging that the reference does not resolve for me.

On ordering: agreed that #16079 should go first if it is ready. Ping me when it lands and I will merge quattro into this branch and keep both halves — its --setenv=XDG_ACTIVATION_TOKEN rides the systemd-run unit, this PR's started_browser guard decides whether to focus afterwards, and each adds one case to the same test file, so the merge is mechanical.

Branch still reads MERGEABLE against quattro; Greptile is green on the current head.

@dmkenney

Copy link
Copy Markdown
Contributor

#16608 is a discussion, not an issue, so gh api repos/hyprwm/Hyprland/issues/16608 returns 404. It's here: hyprwm/Hyprland#16608

To look it up from the CLI: gh api graphql -f query='{repository(owner:"hyprwm",name:"Hyprland"){discussion(number:16608){title url closed}}}'

@kouyichi

Copy link
Copy Markdown
Author

Right — my 404 read was wrong. Confirmed from the CLI with the GraphQL form you gave:

gh api graphql -f query='{repository(owner:"hyprwm",name:"Hyprland"){discussion(number:16608){title url closed}}}'
→ "Activation tokens with old serials still steal focus after #16427"
  https://github.com/hyprwm/Hyprland/discussions/16608  closed: false

So the reference in the write-up resolves exactly as written and needs no change; I have corrected my own note to say discussion, not PR, and will use discussion(number:) for that repo from now on. (#16606 is the same shape and is closed, which is what the correction on #16078 says.)

Gate re-checked just now, unchanged, so nothing to do on this branch: omacom/omarchy-pkgs#1379 OPEN, omacom/omarchy-pkgs#1367 OPEN, omacom/omarchy#16097 OPEN, and omacom/omarchy#16079 (the one I would merge quattro for) OPEN. hyprwm/Hyprland#16427 is still the only merged item.

Head stays 973cee8, no commits. When #1379, #16097 and #1367 ship, the rule comes out as described — the two o.window opt-outs plus their assertions in test/shell.d/hyprland-browser-focus-test.sh — leaving the launcher half. Say the word then and I will cut it here.

…e-browsers

Conflict: apps/browser.lua's chromium tag rule. Upstream moved that literal
pattern into o.chromium_browsers (default/hypr/helpers.lua), so the tag rule
now takes the helper and this branch's comment above it stays as written --
the helper is the same unscoped pattern, which is what the tag rule needs.

The launcher test also needed a rebase-shaped update: upstream's
omarchy-launch-browser now resolves Exec= through omarchy-cmd-default-browser
and exits 1 when nothing resolves, so the handoff case has to keep $ROOT/bin
on PATH like its sibling cases or it aborts before the assertion runs.
@kouyichi

Copy link
Copy Markdown
Author

Merged quattro up to 5ec4362d (merge commit ad20f4f). No change to the rule itself — still holding for the Hyprland/omarchy-pkgs gate as agreed, so treat this as base maintenance only.

What the merge needed:

  • apps/browser.lua: upstream moved the Chromium literal into o.chromium_browsers (helpers.lua). The tag rule now takes the helper; the comment block above it and the two anchored focus_on_activate = false rules are unchanged. Diff against quattro is the same four files as before.
  • launch-browser-test.sh: omarchy-launch-browser now resolves Exec= through omarchy-cmd-default-browser and exits 1 when nothing resolves, so the handoff case has to carry $ROOT/bin on PATH like its sibling cases — without it the launcher aborts before the focus assertion runs.

Verified at ad20f4f: bash test/shell.d/hyprland-browser-focus-test.sh → 5 ok / 0 failed, bash test/shell.d/launch-browser-test.sh → 9 ok / 0 failed.

AGENTS.md asks for no test of a small declarative change, and for extending an
area's existing test file rather than adding a new *-test.sh. The two
focus_on_activate rules are config values, so the standalone file goes; the
launcher case in launch-browser-test.sh stays, because it covers the branch that
decides whether a handed-off URL is focused.

Refs omacom#14283
@kouyichi

Copy link
Copy Markdown
Author

Took the P2 on the config test — removed it in 40f485f5.

You are right that AGENTS.md rules it out: "No test for a small declarative change: a menu row, a config value, a package-list entry, a string, a rename", plus "Extend the area's existing test file rather than adding a new *-test.sh". The two focus_on_activate rules are config values, so test/shell.d/hyprland-browser-focus-test.sh is gone rather than trimmed — a smaller version of it in the same new file would break the same rule.

What is left, and why:

  • bin/omarchy-launch-browser and its case in test/shell.d/launch-browser-test.sh — that case drives the real branch (started_browser), so it fails on the base branch for the behaviour the fix exists for, which is what the guide asks of a test. Kept.
  • The reasoning the removed assertions encoded — anchored class patterns so a web app's chrome-<host>_<path>-Default is not caught, and the notification path that has no escape from the opt-out — is in the comment block above the rules in default/hypr/apps/browser.lua. That is where the next reader hits it, and it costs no suite time.

This also makes the earlier P2 about if rule.focus_on_activate == false moot: the classification loop it pointed at no longer exists.

Diff against quattro is now 3 files, +53/-2 (launcher, browser.lua, launch-browser-test.sh). Verified at 40f485f5: bash test/shell.d/launch-browser-test.sh -> 9 ok / 0 failed.

@kouyichi

Copy link
Copy Markdown
Author

Merged upstream/quattro (04cd61ae9) into the branch (merge commit 1546874b4, plain merge, no rebase or force-push) to resolve the conflict in bin/omarchy-launch-browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants