Kaydet (Commit) 0f3712ff authored tarafından Herbert Dürr's avatar Herbert Dürr

#i119006# delay AOO/Mac initial event until the app has finished lauching

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. This should solve one of the
most popular support questions for AOO on Mac for good.
üst a8c471a7
...@@ -213,19 +213,6 @@ sal_Bool ImplSVMainHook( sal_Bool * pbInit ) ...@@ -213,19 +213,6 @@ sal_Bool ImplSVMainHook( sal_Bool * pbInit )
bNoSVMain = false; bNoSVMain = false;
initNSApp(); initNSApp();
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];
rtl::OUString aExeURL, aExe; rtl::OUString aExeURL, aExe;
osl_getExecutableFile( &aExeURL.pData ); osl_getExecutableFile( &aExeURL.pData );
osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData ); osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData );
...@@ -239,11 +226,6 @@ sal_Bool ImplSVMainHook( sal_Bool * pbInit ) ...@@ -239,11 +226,6 @@ sal_Bool ImplSVMainHook( sal_Bool * pbInit )
const char* pArgv[] = { aByteExe.getStr(), NULL }; const char* pArgv[] = { aByteExe.getStr(), NULL };
NSApplicationMain( 1, pArgv ); NSApplicationMain( 1, pArgv );
#endif #endif
}
else
{
DBG_ERROR( "NSApplication initialization could not be done" );
}
return TRUE; // indicate that ImplSVMainHook is implemented return TRUE; // indicate that ImplSVMainHook is implemented
} }
......
...@@ -54,6 +54,22 @@ ...@@ -54,6 +54,22 @@
@end @end
@implementation VCL_NSApplication @implementation VCL_NSApplication
-(void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
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];
......
...@@ -40,6 +40,7 @@ class AquaSalFrame; ...@@ -40,6 +40,7 @@ class AquaSalFrame;
@interface VCL_NSApplication : NSApplication @interface VCL_NSApplication : NSApplication
{ {
} }
-(void)applicationDidFinishLaunching:(NSNotification*)aNotification;
-(void)sendEvent:(NSEvent*)pEvent; -(void)sendEvent:(NSEvent*)pEvent;
-(void)sendSuperEvent:(NSEvent*)pEvent; -(void)sendSuperEvent:(NSEvent*)pEvent;
-(NSMenu*)applicationDockMenu:(NSApplication *)sender; -(NSMenu*)applicationDockMenu:(NSApplication *)sender;
......
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