Kaydet (Commit) 2c752855 authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

Resolves: #i119006# delay Mac initial event until the app has launched

delaying the initial event prevents complaints from OSX>=10.7's "windows
restore" feature to recur infinitely. Apparently OSX cleans things up for us
just before we get the applicationDidFinishLaunching() callback.

(cherry picked from commit 0f3712ff)

Conflicts:
	vcl/osx/salinst.cxx

Change-Id: I0f1d59f03ffe4efc7c9a73fa881151fa06af5424
üst 03bdbcb4
...@@ -38,6 +38,7 @@ class AquaSalFrame; ...@@ -38,6 +38,7 @@ class AquaSalFrame;
@interface VCL_NSApplication : NSApplication @interface VCL_NSApplication : NSApplication
{ {
} }
-(void)applicationDidFinishLaunching:(NSNotification*)pNotification;
-(void)sendEvent:(NSEvent*)pEvent; -(void)sendEvent:(NSEvent*)pEvent;
-(void)sendSuperEvent:(NSEvent*)pEvent; -(void)sendSuperEvent:(NSEvent*)pEvent;
-(NSMenu*)applicationDockMenu:(NSApplication *)sender; -(NSMenu*)applicationDockMenu:(NSApplication *)sender;
......
...@@ -194,37 +194,19 @@ sal_Bool ImplSVMainHook( int * pnInit ) ...@@ -194,37 +194,19 @@ sal_Bool ImplSVMainHook( int * pnInit )
bNoSVMain = false; bNoSVMain = false;
initNSApp(); initNSApp();
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined OUString aExeURL, aExe;
location: NSZeroPoint osl_getExecutableFile( &aExeURL.pData );
modifierFlags: 0 osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData );
timestamp: 0 OString aByteExe( OUStringToOString( aExe, osl_getThreadTextEncoding() ) );
windowNumber: 0
context: nil
subtype: AquaSalInstance::AppExecuteSVMain
data1: 0
data2: 0 ];
if( pEvent )
{
[NSApp postEvent: pEvent atStart: NO];
OUString aExeURL, aExe;
osl_getExecutableFile( &aExeURL.pData );
osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData );
OString aByteExe( OUStringToOString( aExe, osl_getThreadTextEncoding() ) );
#ifdef DEBUG #ifdef DEBUG
aByteExe += OString ( " NSAccessibilityDebugLogLevel 1" ); aByteExe += OString ( " NSAccessibilityDebugLogLevel 1" );
const char* pArgv[] = { aByteExe.getStr(), NULL }; const char* pArgv[] = { aByteExe.getStr(), NULL };
NSApplicationMain( 3, pArgv ); NSApplicationMain( 3, pArgv );
#else #else
const char* pArgv[] = { aByteExe.getStr(), NULL }; const char* pArgv[] = { aByteExe.getStr(), NULL };
NSApplicationMain( 1, pArgv ); NSApplicationMain( 1, pArgv );
#endif #endif
}
else
{
OSL_FAIL( "NSApplication initialization could not be done" );
}
return TRUE; // indicate that ImplSVMainHook is implemented return TRUE; // indicate that ImplSVMainHook is implemented
} }
......
...@@ -57,6 +57,24 @@ ...@@ -57,6 +57,24 @@
// desktop/macosx/Info.plist has the value VCL_NSApplication. // desktop/macosx/Info.plist has the value VCL_NSApplication.
@implementation VCL_NSApplication @implementation VCL_NSApplication
-(void)applicationDidFinishLaunching:(NSNotification*)pNotification
{
(void)pNotification;
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint
modifierFlags: 0
timestamp: 0
windowNumber: 0
context: nil
subtype: AquaSalInstance::AppExecuteSVMain
data1: 0
data2: 0 ];
if( pEvent )
[NSApp postEvent: pEvent atStart: NO];
}
-(void)sendEvent:(NSEvent*)pEvent -(void)sendEvent:(NSEvent*)pEvent
{ {
NSEventType eType = [pEvent type]; NSEventType eType = [pEvent type];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment