SplashScreen and NSApplicationAWT

Phil Race philip.race at oracle.com
Wed Nov 23 10:30:54 PST 2011


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