Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/windy/platforms/macos/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ proc applicationDidFinishLaunching(
notification: NSNotification
): ID {.cdecl.} =
NSApp.setPresentationOptions(NSApplicationPresentationDefault)
NSApp.setActivationPolicy(NSApplicationActivationPolicyRegular)
NSApp.activateIgnoringOtherApps(true)

proc windowDidResize(
Expand Down Expand Up @@ -846,6 +845,13 @@ proc init() {.raises: [].} =
addMethod "doCommandBySelector:", doCommandBySelector
addMethod "resetCursorRects", resetCursorRects

# Set activation policy before finishLaunching so the window server has
# time to promote this process to a regular GUI app before we try to
# activate or show any windows. Setting it inside applicationDidFinish-
# Launching is too late — the window server processes policy changes
# asynchronously, causing intermittent failures to come to front.
NSApp.setActivationPolicy(NSApplicationActivationPolicyRegular)

let appDelegate = WindyAppDelegate.new()
NSApp.setDelegate(appDelegate)

Expand Down
Loading