SplashScreen and NSApplicationAWT
Mike Swingler
swingler at apple.com
Wed Nov 30 09:19:19 PST 2011
I think that the simplest design going forward is it kick off a small command line helper process that links against nothing but AppKit, and embeds an Info.plist in it's binary that contains an LSUIElement=true property (so LaunchServices won't inflate a Dock icon for it when it starts).
Regards,
Mike Swingler
Apple Inc.
On Nov 23, 2011, at 10:30 AM, Phil Race wrote:
> I suspect you'll have to do something like #1.
>
> Previous advice on another topic is not to rely on X11. Sounds like a hybrid monster in any case.
> My gut is that this is something to steer well clear of.
>
> Is it possible for an app to start a cocoa event loop for splashscreen, then exit that
> when AWT is ready to launch .. and start up the real one ? I'm afraid the answer
> here will probably be no .. and its probably impossible to do whilst keeping the
> splashscreen visible, but its worth asking.
>
> -phil.
>
> On 11/23/2011 8:11 AM, Anthony Petrov wrote:
>> Hello,
>>
>> Another issue with the splash screen is that it needs to display a window on the screen. For this purpose the Cocoa event loop must be started, and as such an NSApp instance be initialized. And this instance is a singleton in Cocoa.
>>
>> I see that there's already a custom NSApplication descendant present (the NSApplicationAWT), and we can't create and initialize it at the time of splash screen showing since the AWT dynamic library isn't loaded yet.
>>
>> I see two options to resolve this:
>>
>> 1. Move the NSApplciationAWT code into the Java launcher code. Either the splash screen code, or AWT would trigger the creation of an application instance. This approach, however, might require a lot of refactoring.
>>
>> 2. Use Xlib to display the splash screen. This must be the easiest solution, although it may appear a bit inconsistent to the end user (the X icon flashing in the dock, etc. - but perhaps there's a way to suppress that?) Also, I'm not sure if an Xlib-based app is able to actually initialize Cocoa later.
>>
>> Any thoughts on this?
>>
>> --
>> best regards,
>> Anthony
>
More information about the macosx-port-dev
mailing list