changeset 2073:cf70a52f702e

Mac: Changes to actively display the notification on versions prior to Mojave 10.14.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 15 May 2020 11:25:07 +0000
parents b7514ecd6305
children 1a196ada0bc9
files mac/dw.m
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Fri May 15 04:54:57 2020 +0000
+++ b/mac/dw.m	Fri May 15 11:25:07 2020 +0000
@@ -1341,11 +1341,13 @@
 /* Subclass for the application class */
 @interface DWAppDel : NSObject
 #ifdef BUILDING_FOR_SNOW_LEOPARD
-<NSApplicationDelegate>
+<NSApplicationDelegate, NSUserNotificationCenterDelegate>
 #endif
 {
 }
 -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+-(void)applicationDidFinishLaunching:(NSNotification *)aNotification;
+-(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification;
 @end
 
 /* Apparently the WKWebKit API is only enabled on intel 64bit...
@@ -1432,6 +1434,20 @@
         return NSTerminateCancel;
     return NSTerminateNow;
 }
+-(void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+#ifdef BUILDING_FOR_MOJAVE
+    if (!@available(macOS 10.14, *))
+#endif
+    {
+        NSUserNotificationCenter* unc = [NSUserNotificationCenter defaultUserNotificationCenter];
+        unc.delegate = self;
+    }
+}
+-(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification
+{
+    return YES;
+}
 @end
 
 /* Subclass for a top-level window */