• Jan-Marek Glogowski's avatar
    OSX Re-Introduce NSApplicationMain usage · 284a7f60
    Jan-Marek Glogowski yazdı
    This restores the nested NSApplicationMain and default run loop
    usage. Without it the Java AWT integration will start its own
    event loop, effectively blocking any non-system event processing.
    
    Reproducible via "Tools - Macros - Organize Macros - BeanShell...
    - LibreOffice Macros - HelloWorld - helloworld.bsh - Edit".
    
    The blocking can be prevented by overriding NSApplication::run and
    running our own event loop using Application::Execute. But this
    still doesn't show the Java AWT editor window and I couldn't find
    any information how to fix this.
    
    Since OSX now is a VCL plugin, this can't restore the old hook
    mechanism, but instead adds a new function to SalInstance.
    SalInstance initialization happens at InitVCL() start just a
    little bit later in the call stack.
    
    Somehow NSApplicationMain manages to run the Java VM in an extra
    thread, so it doesn't block the main loop. Probably this could
    also be handled by LO starting the JVM as a thread.
    Further information for an implementation eventually can be found
    in the "Technical Note TN2147" "JNI Development on Mac OS X."
    
    Change-Id: I04a0c2bf7949571f1b678ada9ab3592e0fe30c1f
    Regression-from: 925e2edb
    Reviewed-on: https://gerrit.libreoffice.org/65836
    Tested-by: Jenkins
    Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
    284a7f60
salmenu.cxx 27.5 KB