gl/cocoa: Simplify NSApplication initialisation for console apps
@arun
Submitted by Arun Raghavan Link to original bug (#741054)
Description
This fixes a deadlock and makes failure to initialise the NSApp explicitly
fail. I looked at how GDK deals with this on Sebastian's suggestion, and that
looks a bit more involved -- we would need to replace the GLib poll function
with a Cocoa event poll function, and move fd polling to a separate thread. In
my mind, this is quite a lot of complexity for a bit of a corner case. Either
way, this patch should make things better, not worse, while we try to find a
more robust solution.
The GDK solution, for the curious:
https://git.gnome.org/browse/gtk+/tree/gdk/quartz/gdkeventloop-quartz.c#n12