git.ithinksw.org
/
ITKit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a crash when Core Image was available.
[ITKit.git]
/
ITCoreImageWindowEffect.m
diff --git
a/ITCoreImageWindowEffect.m
b/ITCoreImageWindowEffect.m
index
9fd49aa
..
afef08f
100644
(file)
--- a/
ITCoreImageWindowEffect.m
+++ b/
ITCoreImageWindowEffect.m
@@
-14,11
+14,13
@@
- (void)setupEffect;
@end
- (void)setupEffect;
@end
+static BOOL _running = NO;
+
@implementation ITCoreImageWindowEffect
+ (NSString *)effectName
{
@implementation ITCoreImageWindowEffect
+ (NSString *)effectName
{
- return @"
Core Image -
Ripple";
+ return @"Ripple";
}
+ (NSDictionary *)supportedPositions
}
+ (NSDictionary *)supportedPositions
@@
-96,6
+98,7
@@
[self setWindowVisibility:ITWindowVisibleState];
__idle = YES;
[self setWindowVisibility:ITWindowVisibleState];
__idle = YES;
+
if ( __shouldReleaseWhenIdle ) {
[self release];
}
if ( __shouldReleaseWhenIdle ) {
[self release];
}
@@
-119,10
+122,10
@@
- (void)performVanish
{
- (void)performVanish
{
- __idle = NO;
+
__idle = NO;
- [self setWindowVisibility:ITWindowVanishingState];
- [self performVanishFromProgress:1.0 effectTime:_effectTime];
+
[self setWindowVisibility:ITWindowVanishingState];
+
[self performVanishFromProgress:1.0 effectTime:_effectTime];
}
- (void)performVanishFromProgress:(float)progress effectTime:(float)time
}
- (void)performVanishFromProgress:(float)progress effectTime:(float)time
@@
-166,7
+169,7
@@
[self setWindowVisibility:ITWindowHiddenState];
__idle = YES;
[self setWindowVisibility:ITWindowHiddenState];
__idle = YES;
-
+
if ( __shouldReleaseWhenIdle ) {
[self release];
}
if ( __shouldReleaseWhenIdle ) {
[self release];
}
@@
-192,6
+195,12
@@
NSRect rippleRect = [_window frame];
NSRect screenRect = [[_window screen] frame];
NSRect rippleRect = [_window frame];
NSRect screenRect = [[_window screen] frame];
+ if (_running) {
+ //Short-circuit to avoid layering effects and crashing
+ return;
+ }
+
+ _running = YES;
_ripple = YES;
rippleRect.origin.y = - (NSMaxY(rippleRect) - screenRect.size.height);
_ripple = YES;
rippleRect.origin.y = - (NSMaxY(rippleRect) - screenRect.size.height);
@@
-259,6
+268,8
@@
[[_effectWindow contentView] release];
[_effectWindow release];
[pool release];
[[_effectWindow contentView] release];
[_effectWindow release];
[pool release];
+
+ _running = NO;
}
@end
}
@end