Commits

Peter Hosey committed 1b90cdb

Only notify when iTunes is not the active app. Fixes #111.

Comments (0)

Files changed (1)

Extras/GrowlTunes/GrowlTunesController.m

 #pragma mark iTunes 4.7 notifications
 
 - (void) songChanged:(NSNotification *)aNotification {
+	BOOL iTunesIsTheActiveApp = ([[[[NSWorkspace sharedWorkspace] activeApplication] objectForKey:@"NSApplicationBundleIdentifier"] caseInsensitiveCompare:ITUNES_BUNDLE_ID] == NSOrderedSame);
+
 	NSString     *playerState = nil;
 	iTunesState   newState    = itUNKNOWN;
 	NSString     *newTrackURL = nil;
 		BOOL isStream = [newTrackURL hasPrefix:@"http://"];
 		BOOL descriptionChanged = ![lastPostedDescription isEqualToString:displayString];
 		if (URLChanged || (isStream && descriptionChanged)) {
-			// Tell Growl
-			[GrowlApplicationBridge notifyWithDictionary:noteDict];
+			if (!iTunesIsTheActiveApp) {
+				// Tell Growl
+				[GrowlApplicationBridge notifyWithDictionary:noteDict];
+			}
 
 			// Recent Tracks
 			if (streamTitle && [streamTitle length]) {