adium 3034:179a22b315e7: Patch from Luca Motta ('''lucamot''') w...
commits at adium.im
commits at adium.im
Tue Dec 8 04:32:06 UTC 2009
details: http://hg.adium.im/adium/rev/179a22b315e7
revision: 3034:179a22b315e7
author: Evan Schoenberg
date: Mon Dec 07 22:35:22 2009 -0600
Patch from Luca Motta ('''lucamot''') which fixes #13537 ("Dock icon not updating after system is put to sleep"). Thanks!
diffs (53 lines):
diff -r 03fbcb47ee5f -r 179a22b315e7 Source/AIDockController.m
--- a/Source/AIDockController.m Mon Dec 07 22:25:17 2009 -0600
+++ b/Source/AIDockController.m Mon Dec 07 22:35:22 2009 -0600
@@ -383,25 +383,32 @@
[iconStates addObject:state];
}
- //Generate the composited icon state
- [currentIconState release];
- currentIconState = [[AIIconState alloc] initByCompositingStates:iconStates];
-
- if (![currentIconState animated]) { //Static icon
- NSImage *image = [currentIconState image];
- if (image) {
- [[NSApplication sharedApplication] setApplicationIconImage:image];
+ @try {
+ //Generate the composited icon state
+ [currentIconState release];
+ currentIconState = [[AIIconState alloc] initByCompositingStates:iconStates];
+
+ if (![currentIconState animated]) { //Static icon
+ NSImage *image = [currentIconState image];
+ if (image) {
+ [[NSApplication sharedApplication] setApplicationIconImage:image];
+ }
+ } else { //Animated icon
+ //Our dock icon can run its animation at any speed, but we want to try and sync it with the global Adium flashing. To do this, we delay starting our timer until the next flash occurs.
+ [adium.interfaceController registerFlashObserver:self];
+ observingFlash = YES;
+
+ //Set the first frame of our animation
+ [self animateIcon:nil]; //Set the icon and move to the next frame
}
- } else { //Animated icon
- //Our dock icon can run its animation at any speed, but we want to try and sync it with the global Adium flashing. To do this, we delay starting our timer until the next flash occurs.
- [adium.interfaceController registerFlashObserver:self];
- observingFlash = YES;
-
- //Set the first frame of our animation
- [self animateIcon:nil]; //Set the icon and move to the next frame
}
-
- needsDisplay = NO;
+ @catch (NSException *exception) {
+ if ([[exception name] isEqualToString:NSImageCacheException])
+ currentIconState = nil;
+ }
+ @finally {
+ needsDisplay = NO;
+ }
}
- (void)flash:(int)value
More information about the commits
mailing list