fix(tray): re-apply panel bounds after show to stop half-size popups on Windows - #3209
fix(tray): re-apply panel bounds after show to stop half-size popups on Windows#3209netcatty-bot wants to merge 1 commit into
Conversation
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
Summary
boundsMatchhelper (1px tolerance) plus aBOUNDS_MATCH_TOLERANCE_PXconstant to the pure bounds module so the comparison stays testable and out of the bridge.did-finish-loadshow can verify even thoughshowTrayPanelhas already returned; the state is reset on cleanup.Why
On Windows the transparent, non-resizable tray popup can ignore the
setBoundspushed while it is hidden: at show time the shell keeps (or re-applies) a stale rect, so the panel pops up at roughly half its designed size with fully readable but scaled-down content — exactly the symptom reported in #3064 and still reproducible in 1.1.82 (#3181), on both 200% and 100% display scale. The previous fix (#3068) computed the correct rect but only applied it before the window was shown; a wrong show-time result was never detected or corrected.Changes
electron/bridges/globalShortcutBridge.cjs: newensureTrayPanelBounds(compare live bounds, re-apply once if mismatched), called right afterwin.show()in both show paths; remembered intended bounds intrayPanelPendingBounds.electron/bridges/trayPanelBounds.cjs: pureboundsMatchcomparison helper (no Electron dependency).trayPanelBounds.test.cjscoversboundsMatch;globalShortcutBridge.test.cjsadds a fake-window regression test where the pre-showsetBoundsis undone (Windows glitch model) and asserts the panel is corrected to the designed 360x520 rect after show, plus a guard test that no redundant resize happens when the originalsetBoundsalready stuck.Testing
node --test electron/bridges/trayPanelBounds.test.cjs electron/bridges/globalShortcutBridge.test.cjs— 50/50 pass.node --test electron/bridges/*.test.cjs— 2036 pass, 0 fail.npx eslinton the four changed files — clean.Fixes #3181
Automation
@codex review(own/bot PRs only)