summaryrefslogtreecommitdiff
path: root/src/macos/Sources/main.swift
diff options
context:
space:
mode:
Diffstat (limited to 'src/macos/Sources/main.swift')
-rw-r--r--src/macos/Sources/main.swift16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/macos/Sources/main.swift b/src/macos/Sources/main.swift
new file mode 100644
index 00000000..6cb2646e
--- /dev/null
+++ b/src/macos/Sources/main.swift
@@ -0,0 +1,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()