comparison mac/dw.m @ 2119:34963d1e6f62

Mac: Fix notification fallback code for prior to Mojave but building for Mojave or later.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Jun 2020 22:48:46 +0000
parents cdc5124b6525
children 7ce8ecb79d4b
comparison
equal deleted inserted replaced
2118:c3f088266bcd 2119:34963d1e6f62
1437 { 1437 {
1438 if(_event_handler(sender, nil, 6) > 0) 1438 if(_event_handler(sender, nil, 6) > 0)
1439 return NSTerminateCancel; 1439 return NSTerminateCancel;
1440 return NSTerminateNow; 1440 return NSTerminateNow;
1441 } 1441 }
1442 #ifdef BUILDING_FOR_MOUNTAIN_LION
1442 -(void)applicationDidFinishLaunching:(NSNotification *)aNotification 1443 -(void)applicationDidFinishLaunching:(NSNotification *)aNotification
1443 { 1444 {
1444 #ifdef BUILDING_FOR_MOJAVE 1445 #ifdef BUILDING_FOR_MOJAVE
1445 if (@available(macOS 10.14, *)) {} else 1446 if (@available(macOS 10.14, *)) {} else
1446 #else 1447 #endif
1447 { 1448 {
1448 #ifdef BUILDING_FOR_MOUNTAIN_LION
1449 NSUserNotificationCenter* unc = [NSUserNotificationCenter defaultUserNotificationCenter]; 1449 NSUserNotificationCenter* unc = [NSUserNotificationCenter defaultUserNotificationCenter];
1450 unc.delegate = self; 1450 unc.delegate = self;
1451 #endif 1451 }
1452 }
1453 #endif
1454 return; 1452 return;
1455 } 1453 }
1456 #ifdef BUILDING_FOR_MOUNTAIN_LION
1457 -(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification 1454 -(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification
1458 { 1455 {
1459 return YES; 1456 return YES;
1460 } 1457 }
1461 -(void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)usernotification 1458 -(void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)usernotification