summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-01-03 13:45:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-12 19:07:43 +0100
commitd94f96c56d858cfd20bd7fac0c357ea0ecc24785 (patch)
treeb4b314b49888a56dc8d88c08d6ca59dffc4982fa /vcl/inc
parentbbdd753f1e0155c483a554d3f28cbc3f1521105d (diff)
OSX Re-Introduce NSApplicationMain usage
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: 925e2edb6f3f8fffcff9eddb31ed18bc77e2a690 Reviewed-on: https://gerrit.libreoffice.org/65836 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 284a7f60fff72c4d8c011ff60ea2e40163cd25c3) Reviewed-on: https://gerrit.libreoffice.org/66192 Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/osx/salinst.h3
-rw-r--r--vcl/inc/salinst.hxx1
2 files changed, 3 insertions, 1 deletions
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 18b8de8cfc7f..edece53b6bea 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -91,6 +91,7 @@ public:
virtual ~AquaSalInstance() override;
virtual void AfterAppInit() override;
+ virtual bool SVMainHook(int *) override;
virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
@@ -145,7 +146,7 @@ public:
void endedPrintJob() { mnActivePrintJobs--; }
// event subtypes for NSApplicationDefined events
- static const short AppEndLoopEvent = 1;
+ static const short AppExecuteSVMain = 1;
static const short AppStartTimerEvent = 10;
static const short YieldWakeupEvent = 20;
static const short DispatchTimerEvent = 30;
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index f48cca4136e2..e35cd78df4fb 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -89,6 +89,7 @@ public:
//called directly after Application::Init
virtual void AfterAppInit() {}
+ virtual bool SVMainHook(int*) { return false; }
// Frame
// DisplayName for Unix ???