SplashScreen and NSApplicationAWT

Anthony Petrov anthony.petrov at oracle.com
Wed Nov 23 08:11:55 PST 2011


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