diff --git a/src/ui/osx/TogglDesktop/App/AppDelegate.m b/src/ui/osx/TogglDesktop/App/AppDelegate.m index 57235cefdc..ad73cfe02d 100644 --- a/src/ui/osx/TogglDesktop/App/AppDelegate.m +++ b/src/ui/osx/TogglDesktop/App/AppDelegate.m @@ -111,6 +111,8 @@ @interface AppDelegate () @property (nonatomic, assign) BOOL manualMode; @property (nonatomic, assign) BOOL onTop; +@property (nonatomic) BOOL isAppIconInRunningState; + @end @implementation AppDelegate @@ -126,6 +128,7 @@ - (void)applicationWillFinishLaunching:(NSNotification *)not self.showMenuBarTimer = NO; self.manualMode = NO; self.onTop = NO; + self.isAppIconInRunningState = YES; } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification @@ -888,7 +891,11 @@ - (void)displayTimerState:(TimeEntryViewItem *)timeEntry { if (!self.willTerminate) { - [NSApp setApplicationIconImage:[AppIconFactory appIconWithType:AppIconTypeActive]]; + if (!self.isAppIconInRunningState) + { + [NSApp setApplicationIconImage:[AppIconFactory appIconWithType:AppIconTypeActive]]; + self.isAppIconInRunningState = YES; + } } [self updateStatusItem]; @@ -918,7 +925,11 @@ - (void)indicateStoppedTimer { // Change app dock icon to default // See https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/customizing_docktile/dockconcepts.pdf - [NSApp setApplicationIconImage:[AppIconFactory appIconWithType:AppIconTypeDefault]]; + if (self.isAppIconInRunningState) + { + [NSApp setApplicationIconImage:[AppIconFactory appIconWithType:AppIconTypeDefault]]; + self.isAppIconInRunningState = NO; + } } [self updateStatusItem]; diff --git a/src/ui/osx/TogglDesktop/Common/Utils/AppIconFactory.m b/src/ui/osx/TogglDesktop/Common/Utils/AppIconFactory.m index f5280e70b1..a2d2ee852f 100644 --- a/src/ui/osx/TogglDesktop/Common/Utils/AppIconFactory.m +++ b/src/ui/osx/TogglDesktop/Common/Utils/AppIconFactory.m @@ -28,9 +28,6 @@ + (NSImage *)appIconWithType:(AppIconType)type icon = [NSImage imageNamed:@"AppIconNotRunning"]; break; } - - // Adapt well with black/white macOS appearance - icon.template = YES; return icon; }