summaryrefslogtreecommitdiff
path: root/src/macos/Sources/main.swift
blob: 6cb2646ee700027717c08a2f8d91a0c1737c0016 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import AppKit

// Ghostty's ordering lesson: whatever must exist before AppKit boots goes above
// app.run(), because after that call the runloop owns this thread forever.
// pardes has nothing in that class — the core cannot come up until there is a
// window to measure, so pardes_init waits for applicationDidFinishLaunching.

let app = NSApplication.shared
app.setActivationPolicy(.regular)

// NSApplication does not own its delegate. This is a global, so it lives as
// long as the process does; the same line inside a function would not.
let delegate = AppDelegate()
app.delegate = delegate

app.run()