fix: bring window to front when opening .md file via Finder on macOS#213
Merged
LarryZhu-dev merged 1 commit intoAuto-Plugin:mainfrom May 6, 2026
Merged
Conversation
The `open-file` event handler sent file data to the renderer via IPC but never called focus()/show()/restore() on the window. This caused double-clicking a .md file in Finder to load the file content silently without bringing the app window to the foreground. Fixed by adding window activation calls in sendFileToRenderer's sendFile closure, aligning with the existing second-instance handler behavior.
Contributor
|
@dongyccc 感谢贡献 |
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
Fixed a bug where double-clicking a
.mdfile in Finder on macOS loads the file content silently without bringing the milkup window to the foreground. Users have to manually click the app icon in the Dock to see the window.Root Cause
The
open-fileevent handler (src/main/index.ts:292) callssendFileToRenderer()which sends file data to the renderer via IPC, but never callsfocus()/show()/restore()on the window.In contrast, the
second-instancehandler (line 280) andactivatehandler (line 320) both correctly activate the window before processing.Fix
Added 3 lines in
sendFileToRenderer'ssendFileclosure to mirror the window activation logic already present insecond-instance:Affected Scenarios
Tested