Repository navigation
Focus the browser by its desktop entry's window class - #18640
Conversation
[Medium impact] The PR appears safe to merge. Summary
Reviews (4) · Last reviewed commit: "Match the declared window class as given..." · Reviewed by Greptile |
…hing A desktop entry's StartupWMClass can be stale (a copied or edited override in ~/.local/share/applications) or overridden at launch (a --class flag in the browser's flags file). Focusing only by it then finds no window where the binary-name guess used to, so try the guess after the declared class misses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@meta.com>
|
Thanks @stevederico. I reproduced the bug and the fix with a real Zen install ( I ran the same check for the other browsers One fix pushed to your branch (8e84c2e): if the declared class finds no window, the launcher now falls back to the old binary-name guess. Before this, any entry with a Tests: run on the VM at 8e84c2e. Second opinion: Codex Medium and muse-wonder (via pi, thinking high) reviewed it over two rounds. In the first round, both found the missing fallback on their own, which is what the pushed commit fixes. They also suggested reading Overlaps: #12786, #15634, #13240 and #17134 also rewrite this focus line, for other bugs (web app windows, agent browsers, env and flatpak wrappers). Whichever lands first will leave the others to resolve a conflict. When an entry declares a class, the exact match here already avoids web app and It is now waiting on the maintainer. |
omarchy-hyprland-focus-app matches its pattern as a case-insensitive regex, and a class with a regex character either over-matches harmlessly or fails to the binary-name fallback, so the escaping went. The test keeps the zen case that fails on the base branch. Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I merged current What was checked, on an Omarchy worker, against the merged branch:
Claude Opus 5.5 at high effort reviewed the changes as a second opinion; its findings are folded in. Its independence from my review isn't guaranteed. Greptile scores the new head 5/5 with no open findings. This waits on the maintainer. |
…ommands Read StartupWMClass from the desktop file selected by the shared Exec parser, so the window-class focus fix from omacom#18640 and wrapped command launching use the same entry. Keep quattro's declared-class lookup and binary-name fallback. Co-Authored-By: GPT-6 <noreply@openai.com>
fixes #18623
omarchy-launch-browserfocuses the browser after opening a URL, but it guessed the window class from the binary name in the desktop entry'sExec=. That misses any browser whose binary is not named after its class. Zen runs/opt/zen-browser-bin/zen-binwith classzen, Vimma runsvimma-openwith classvimma-vimma. The|| truehid the miss, so the link opened and focus stayed where it was.Now the script reads
StartupWMClass=from the same desktop entry it takesExec=from and focuses that class (^zen$). If it finds no window, or the entry has noStartupWMClass, it falls back to the old binary name guess. Nothing about how the browser is launched changes.Tested
bash test/shell.d/launch-browser-test.shpasses on current quattro. New cases:Exec=.../zen-bin %u,StartupWMClass=zen) focuses^zen$StartupWMClassstill focuses^chromium.*$bash -n bin/omarchy-launch-browserNot tested against a real Zen or Vimma install.