Repository navigation
Fix Windows second-instance window focus - #4403
Merged
Merged
Conversation
Contributor
Author
|
Additional validation after opening the PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BrowserWindow.focus()alone is not enoughDiagnosis
On the installed Windows RC, clicking Orca again did launch a second process, but it exited after failing the single-instance lock:
The primary process was still alive and had a visible
Chrome_WidgetWin_1window titledOrca, so this was not the Codex SQLite/runtime-home crash path. The bad behavior was that the primary instance did not reliably surface its existing window, making the app look like it failed to launch.Verification
pnpm vitest run --config config/vitest.config.ts src/main/window/focus-existing-window.test.ts src/main/startup/single-instance-lock.test.tspnpm exec oxlint src/main/window/focus-existing-window.ts src/main/window/focus-existing-window.test.ts src/main/index.tspnpm exec tsgo --noEmit -p config/tsconfig.node.json --pretty falseLocal note: these commands pass with existing machine warnings for Node v25 vs repo Node v24 and an unset
${GITHUB_TOKEN}placeholder inC:\Users\jinwo\.npmrc.