only execute app-startup behaviour if we are not a plug-in
This commit is contained in:
@@ -427,23 +427,26 @@ bool wxApp::CallOnInit()
|
|||||||
m_onInitResult = false;
|
m_onInitResult = false;
|
||||||
m_inited = false;
|
m_inited = false;
|
||||||
|
|
||||||
// Feed the upcoming event loop with a dummy event. Without this,
|
if ( !sm_isEmbedded )
|
||||||
// [NSApp run] below wouldn't return, as we expect it to, if the
|
{
|
||||||
// application was launched without being activated and would block
|
// Feed the upcoming event loop with a dummy event. Without this,
|
||||||
// until the dock icon was clicked - delaying OnInit() call too.
|
// [NSApp run] below wouldn't return, as we expect it to, if the
|
||||||
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
// application was launched without being activated and would block
|
||||||
|
// until the dock icon was clicked - delaying OnInit() call too.
|
||||||
|
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||||
location:NSMakePoint(0.0, 0.0)
|
location:NSMakePoint(0.0, 0.0)
|
||||||
modifierFlags:0
|
modifierFlags:0
|
||||||
timestamp:0
|
timestamp:0
|
||||||
windowNumber:0
|
windowNumber:0
|
||||||
context:nil
|
context:nil
|
||||||
subtype:0 data1:0 data2:0];
|
subtype:0 data1:0 data2:0];
|
||||||
[NSApp postEvent:event atStart:FALSE];
|
[NSApp postEvent:event atStart:FALSE];
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
|
}
|
||||||
|
|
||||||
m_onInitResult = OnInit();
|
m_onInitResult = OnInit();
|
||||||
m_inited = true;
|
m_inited = true;
|
||||||
if ( m_onInitResult )
|
if ( !sm_isEmbedded && m_onInitResult )
|
||||||
{
|
{
|
||||||
if ( m_openFiles.GetCount() > 0 )
|
if ( m_openFiles.GetCount() > 0 )
|
||||||
MacOpenFiles(m_openFiles);
|
MacOpenFiles(m_openFiles);
|
||||||
|
Reference in New Issue
Block a user