More TODO resolution and debugging stuff.

This commit is contained in:
Pietro Gagliardi 2015-04-10 13:39:45 -04:00
parent 016a05aebf
commit e88809179b
2 changed files with 22 additions and 3 deletions

View File

@ -14,11 +14,31 @@
{ {
// yes that's right folks: DO ABSOLUTELY NOTHING. // yes that's right folks: DO ABSOLUTELY NOTHING.
// the magic is [NSApp run] will just... stop. // the magic is [NSApp run] will just... stop.
// for debugging
NSLog(@"in terminate:");
} }
@end @end
// TODO applicationShouldTerminateAfterLastWindowClosed @interface uiAppDelegate : NSObject <NSApplicationDelegate>
@end
@implementation uiAppDelegate
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
{
// for debugging
NSLog(@"in applicationShouldTerminate:");
return NSTerminateNow;
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)app
{
return NO;
}
@end
uiInitOptions options; uiInitOptions options;
@ -29,6 +49,7 @@ uiInitError *uiInit(uiInitOptions *o)
// don't check for a NO return; something (launch services?) causes running from application bundles to always return NO when asking to change activation policy, even if the change is to the same activation policy! // don't check for a NO return; something (launch services?) causes running from application bundles to always return NO when asking to change activation policy, even if the change is to the same activation policy!
// see https://github.com/andlabs/ui/issues/6 // see https://github.com/andlabs/ui/issues/6
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp setDelegate:[uiAppDelegate new]];
return NULL; return NULL;
} }

View File

@ -1,8 +1,6 @@
// 6 april 2015 // 6 april 2015
#import "uipriv_darwin.h" #import "uipriv_darwin.h"
// TODO merge with init_darwin.m?
void uiMain(void) void uiMain(void)
{ {
[NSApp run]; [NSApp run];