fix: re-hide macos dock icon after parentless dialogs - #3100
Open
afonsojramos wants to merge 2 commits into
Open
fix: re-hide macos dock icon after parentless dialogs#3100afonsojramos wants to merge 2 commits into
afonsojramos wants to merge 2 commits into
Conversation
|
Member
|
should this logic be within electron-menubar based on this config param being set? Line 34 in c83528d |
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
Since v7.0.0 the macOS dock icon occasionally reappears even though Gitify runs as a dock-hidden (accessory) app, and only a restart re-hides it.
Investigation
Tested live on macOS by driving the real built app (hidden window,
setVisibleOnAllWorkspaces, accessory policy) and measuringapp.dock.isVisible():app.dock.hide()can be silently dropped when it races an app activation transition. In the experiment,hide()called 500ms after the dock became visible left the icon showing; a laterhide()succeeded.electron-menubarcallsdock.hide()very early in startup, so a lost race there leaves the icon stuck for the whole session. A restart re-rolls the race, which matches "occasionally showing" + "restart restores it".Fix
ready, if the dock is visible, callapp.dock.hide(). Guarded onisVisible()becausedock.hide()also deactivates the app, so it must not run unconditionally near window-show paths (that would steal the popup's focus and trigger the blur auto-hide).Tests
startup.test.ts: re-hides when the dock is visible after the delay; leaves it alone when already hidden.updater.test.ts: dismissing the update dialog re-hides the dock.first-run.test.ts: the dock is re-hidden after the prompt closes.pnpm check,tsc --noEmit, and the affected suites pass (27 tests).Closes #3069