Repository navigation
Conversation
Automated AI review
Reviewed at Verified (isolated sandbox, mocked
The refusal is not visible from the app launcherWhen a tree is running with no window (the #13344 case), the launcher prints "Battle.net is already running…" to stderr and exits 0. Impact: in the #13344 situation (hidden to tray, with no usable tray icon), every relaunch is now refused silently, and there is no way back to the running client short of finding and killing its processes by hand. The issue asked to "end the stale tree (or at minimum warn)". The warning exists, but only on stderr. Suggested change: send the message with The title clause focuses unrelated windows instead of launchingThe filter matches
Impact: when Battle.net is not running, such a window is focused instead, the launcher exits 0 and Battle.net never starts (reproduced end to end with the browser row and the Ghostty-titled terminal row; the foot row was checked with Suggested change: match on class only. It keeps both known client classes and rejects all three unrelated windows above:
Optional test improvement: the Pattern edges: battlenet_running() {
local procs
procs=$(pgrep -af umu-run) || return 1
grep -Fq -- "umu-run $PREFIX/" <<<"$procs"
}In the sandbox this returned false with no tree, true with a tree (including under a Style: AGENTS.md prefers a full Related open PRs:
Review informationTest scope: Source review of AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for the thorough sandbox review on Pushed
Noted the open-PR interactions with #8932 (focus block conflict) and #12432 (scale helper on PATH in tests); happy to adjust further if maintainers want those coordinated. |
Automated AI review
Outcome: At
Refusal advice may not be possibleIt says a copy has no window "(likely tray)" and to "Close it from the system tray or kill its umu-run tree". It also fires while Suggested change: say "already running or still starting" and give one concrete way to stop a hidden copy (a command or Reproducer (message text at 5040288)Reproducer: what the refusal notification saysReviewed head: Whenever a Script#!/bin/bash
# Usage: bash repro-notification.sh <omarchy checkout at 5040288>
# Shows what the launcher tells the user whenever a umu-run process for the
# prefix exists and Hyprland lists no Battle.net window. Nothing real is started.
set -uo pipefail
src=$(cd -- "$1" && pwd)
tmp=$(mktemp -d)
trap 'kill "${sleeper:-}" 2>/dev/null; rm -rf "$tmp"' EXIT
show() { sed "s#$tmp#\$TMP#g"; }
home="$tmp/home"
exe="$home/Games/battlenet/drive_c/Program Files (x86)/Battle.net/Battle.net Launcher.exe"
mkdir -p "$(dirname "$exe")" "$tmp/mock" "$tmp/fake"
: >"$exe"
printf '#!/bin/bash\n[[ $1 == clients ]] && echo "[]"\nexit 0\n' >"$tmp/mock/hyprctl"
printf '#!/bin/bash\necho "umu-run called: $*"\n' >"$tmp/mock/umu-run"
cat >"$tmp/mock/omarchy-notification-send" <<'SH'
#!/bin/bash
printf 'notification argument: %s\n' "$@"
SH
chmod +x "$tmp/mock"/*
# Stands in for a copy that is hidden to tray, or one that umu-run is still
# preparing (Proton download or runtime update) before any window exists.
printf 'import time\ntime.sleep(300)\n' >"$tmp/fake/umu-run"
(exec -a /usr/bin/python python3 "$tmp/fake/umu-run" "$exe") </dev/null >/dev/null 2>&1 &
sleeper=$!
for _ in $(seq 100); do pgrep -af umu-run | grep -Fq "$exe" && break; sleep 0.05; done
echo "running: $(pgrep -af umu-run | show)"
HOME="$home" PATH="$tmp/mock:$PATH" bash "$src/bin/omarchy-launch-battlenet" 2>&1 | show
echo "exit: ${PIPESTATUS[0]}"Actual outputBash 5.3.15, jq 1.8.2, procps-ng 4.0.7 pgrep, in an isolated sandbox with its own PID namespace: Why the wording matters (source, not run here)
DetailsVerified (isolated sandbox, real
Optional test improvement: the Related open PRs: the if/else re-indent now also conflicts with #12432 and #13195 (both merged cleanly with Reproducer (pgrep stub)Reproducer: the test's
|
|
Thanks — follow-up on
Related-PR conflicts noted; happy to rebase once maintainers pick which Battle.net launcher change lands. |
|
@Bartok9 if you want to incorporate the same or similar functionality, I'll drop my PR. Both fixes would be great. |
|
Thanks @nickryand — both fixes are complementary, and I'd rather not leave you maintaining a conflicting launcher diff. #13195 (configurable Until then, heads-up: |
|
Reviewed at Reproduced on a disposable Omarchy worker with the real In the running Hyprland session, with a Tests: Second opinion (Codex Medium): it agreed that the problem is real, that the fixed-string check matches the real Related: #13619 is a newer competing fix for the same issue. This one is older and handles more: it matches the window by class only, so the "Battle.net - Chromium" window above is ignored, where #13619 also matches by title and can focus that window, and it shows a notification instead of exiting silently. This branch also conflicts textually in Nothing was pushed. It is labelled |
|
Thanks — glad this reproduced on a real umu-run tree and a live Hyprland session, and that the suite failures also fail on unmodified quattro. Noted the installer edge: |
umu-run sandboxes each launch so Battle.net never sees its own instance lock, and tray-hidden copies have no window to focus. Focus an existing client when one exists; otherwise skip the relaunch instead of stacking another headless tree. Closes omacom#13344
- Match Hyprland clients by class only (avoid browser/terminal titles) - Fixed-string umu-run+prefix check (HOME metachars, battlenet-old) - Notify via omarchy-notification-send when refusing a headless relaunch - Prefer if/else over early exit; drop command -v guards - Tests use real jq and cover title-only, sibling prefix, and notify
The notification no longer tells people to kill a tree that may still be downloading GE-Proton, and names pkill as the way out when there is no tray. The test stub now requires pgrep -af umu-run so a PID-only call fails.
4a79388 to
66806da
Compare
[Medium impact] The change affects repeat starts through the Battle.net launcher. The overlapping-launch bug still needs a fix before merging. Findings
SummaryThe PR focuses an existing Battle.net window or refuses another launch when a windowless copy is running.
|
| hyprctl dispatch "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || | ||
| hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" >/dev/null 2>&1 || true | ||
| else | ||
| if battlenet_running; then |
There was a problem hiding this comment.
Overlapping launches still stack copies
Two near-simultaneous activations can both pass battlenet_running before either starts umu-run. Both then start separate Proton trees, leaving the duplicate-launch bug possible during startup. Hold a shared lock across the running check and launch, and add an overlapping-launch test.
The notification title already went through omarchy-i18n, but its body was an English literal on a continuation line, where the i18n-check extractor does not look. docs/i18n.md puts every notification string in cli.json, so the body is now battlenet.alreadyRunningBody with the stop command as %1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Re-reviewed at Pushed Reproduced again on a disposable Omarchy worker, using this branch merged into current Tests: Second opinion: Codex Medium and muse-wonder (pi, thinking high) both found the change proportionate and the problem real, and confirmed that the placeholder substitution in
#13619, the competing fix, has been closed, so this is the only open fix for #13344. It still overlaps textually with #8932, #12432 and #13195 in It is labelled |
quattro added DPI matching to omarchy-launch-battlenet (omacom#17418, omacom#18286) and a launch-battlenet-test.sh of its own. The DPI match now runs only on the path that actually launches, so focusing an open window or refusing a windowless tree leaves user.reg alone. The guard's tests join quattro's file in its style: a real windowless process stands in for the hidden tree, so pgrep is no longer stubbed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment said not to tell the user to kill the tree, while the notification below it gives them the pkill command for the hidden copy. It now says what the notification does: offer waiting first, because the tree may still be downloading GE-Proton. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sibling-prefix case passed on quattro's launcher too, so it guarded nothing the house rules count; it is gone. The EXIT trap no longer stops before removing the scratch directory when there is no process to kill, and the windowless tree is waited for at most five seconds instead of forever. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
docs/testing.md asks background fixtures to redirect their output, so an inherited pipe cannot hold the runner open; the wineserver fixture above already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-reviewed after this stopped merging cleanly into Pushed to your branch:
Reproduced on a disposable Omarchy worker with real Tests: on the worker, Second opinion: Codex Medium and muse-wonder (pi, thinking high) reviewed the merge. Both agreed that moving the DPI match into the launch branch keeps everything Still open, for the maintainer: the issue asked whether refusing with a It is labelled |
Summary
omarchy-launch-battlenetalways ranumu-run, so closing Battle.net to tray and relaunching stacked invisible Proton trees (reported as 9 trees / 61 processes).Window-only guards are not enough: a tray-hidden copy has no Hyprland client, and umu-run's sandbox defeats Battle.net's own single-instance lock.
Change
umu-runtree for$HOME/Games/battlenetis already running with no window, refuse to launch another copy.Closes #13344
Base: quattro.