Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We cannot depend on `is_packaged_app()` check because it is not a perfect way of checking if app is bundled. It would return true when the app is bundled with a launcher like this: ```swift import AppKit let task = Process() task.launchPath = "/Users/wojtek/src/otp/bin/erl" task.arguments = ["-noshell", "-eval", "wx:new(), timer:sleep(5000), halt()"] try task.run() task.waitUntilExit() ``` It would return false for this launcher, however: ```swift import AppKit class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { let task = Process() task.launchPath = "/Users/wojtek/src/otp/bin/erl" task.arguments = ["-noshell", "-eval", "wx:new(), timer:sleep(5000), halt()"] try! task.run() } } let app = NSApplication.shared let delegate = AppDelegate() app.delegate = delegate app.run() ``` Btw, there has recently been a fix in wx [1] and we'd only be able to take advantage of it when `OSXIsGUIApplication` returns true (and when wx recognizes our app as properly bundled, see [2]). And so I believe to support variety of scenarios, we need precise control. [1] https://github.com/wxWidgets/wxWidgets #22508 [2] https://github.com/erlang/otp #6070
- Loading branch information