[Bf-blender-cvs] [3590e263e09] master: macOS: Remove user notifications.

Jeroen Bakker noreply at git.blender.org
Thu Jan 12 08:39:57 CET 2023


Commit: 3590e263e09d349f81e131bf80e6b21e0acf07a5
Author: Jeroen Bakker
Date:   Thu Jan 12 08:39:42 2023 +0100
Branches: master
https://developer.blender.org/rB3590e263e09d349f81e131bf80e6b21e0acf07a5

macOS: Remove user notifications.

User notifications in Blender were always annoying and therefore by default turned off.
- When tweaking compositor/material tree a notification was shown.
- When rendering an animation for each frame a notification was shown.

The reason for this was that it was automatically shown when a background job was
finished and Blender wasn't the top most application.

In stead of migrating user notification to UserNotification.framework it was decided
to remove it for now. If in the future notifications should be added back we should
start with a design to figure out where notifications makes sense.

Reviewed By: sergey, brecht

Maniphest Tasks: T103757

Differential Revision: https://developer.blender.org/D16955

===================================================================

M	intern/ghost/intern/GHOST_WindowCocoa.mm

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 849e59cd809..3d0069874e2 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -895,22 +895,13 @@ GHOST_TSuccess GHOST_WindowCocoa::setProgressBar(float progress)
   return GHOST_kSuccess;
 }
 
-static void postNotification()
-{
-  NSUserNotification *notification = [[NSUserNotification alloc] init];
-  notification.title = @"Blender Progress Notification";
-  notification.informativeText = @"Calculation is finished.";
-  notification.soundName = NSUserNotificationDefaultSoundName;
-  [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
-  [notification release];
-}
-
 GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
 {
   if (!m_progressBarVisible)
     return GHOST_kFailure;
   m_progressBarVisible = false;
 
+  /* Reset application icon to remove the progress bar. */
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
   NSImage *dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(128, 128)];
@@ -921,15 +912,6 @@ GHOST_TSuccess GHOST_WindowCocoa::endProgressBar()
                                                 fraction:1.0];
   [dockIcon unlockFocus];
   [NSApp setApplicationIconImage:dockIcon];
-
-  // We use notifications to inform the user when the progress reached 100%
-  // Atm. just fire this when the progressbar ends, the behavior is controlled
-  // in the NotificationCenter If Blender is not frontmost window, a message
-  // pops up with sound, in any case an entry in notifications
-  if ([NSUserNotificationCenter respondsToSelector:@selector(defaultUserNotificationCenter)]) {
-    postNotification();
-  }
-
   [dockIcon release];
 
   [pool drain];



More information about the Bf-blender-cvs mailing list