kCGSTrue = 1
};
+typedef enum {
+ CGSTagExposeFade = 0x0002, // Fade out when Expose activates.
+ CGSTagNoShadow = 0x0008, // No window shadow.
+ CGSTagTransparent = 0x0200, // Transparent to mouse clicks.
+ CGSTagSticky = 0x0800, // Appears on all workspaces.
+} CGSWindowTag;
+
extern void CGStyleRelease(CGStyleRef style);
extern void CGSReleaseObj(void *obj);
extern void CGContextSetStyle(CGContextRef c, CGStyleRef style);
extern CGError CGSSetWindowWarp(const CGSConnectionID cid, CGSWindowID wid, int w,int h, float *mesh);
extern CGError CGSSetWindowTransform(const CGSConnectionID cid, CGSWindowID wid, CGAffineTransform transform);
+extern OSStatus CGSGetWindowTags(const CGSConnectionID cid, const CGSWindowID wid, CGSWindowTag *tags, int thirtyTwo);
+extern OSStatus CGSSetWindowTags(const CGSConnectionID cid, const CGSWindowID wid, CGSWindowTag *tags, int thirtyTwo);
+extern OSStatus CGSClearWindowTags(const CGSConnectionID cid, const CGSWindowID wid, CGSWindowTag *tags, int thirtyTwo);
+
@interface NSApplication (ITCoreGraphicsHacks)
- (CGSConnectionID)contextID;
@end
\ No newline at end of file
- (void)setupEffect;
@end
+static BOOL _running = NO;
+
@implementation ITCoreImageWindowEffect
+ (NSString *)effectName
[self setWindowVisibility:ITWindowVisibleState];
__idle = YES;
+
if ( __shouldReleaseWhenIdle ) {
[self release];
}
- (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
[self setWindowVisibility:ITWindowHiddenState];
__idle = YES;
-
+
if ( __shouldReleaseWhenIdle ) {
[self release];
}
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);
[[_effectWindow contentView] release];
[_effectWindow release];
[pool release];
+
+ _running = NO;
}
@end
float maxHeight = ( screenHeight - (SW_BORDER * 2) );
float excessWidth = 0.0;
float excessHeight = 0.0;
- NSPoint windowOrigin;
+ NSPoint windowOrigin = NSZeroPoint;
ITImageView *imageView;
BOOL shouldAnimate = ( ! (([self visibilityState] == ITWindowAppearingState) ||
([self visibilityState] == ITWindowVanishingState)) );
- (void)setIgnoresMouseEvents:(BOOL)flag
{
- CGSValueObj key;
- CGSValueObj ignore;
+ //CGSValueObj key;
+ //CGSValueObj ignore;
+ CGSWindowTag tags;
- key = CGSCreateCString("IgnoreForEvents");
+ /*key = CGSCreateCString("IgnoreForEvents");
ignore = CGSCreateBoolean( (flag ? kCGSTrue : kCGSFalse) );
CGSSetWindowProperty([NSApp contextID], (CGSWindowID)[self windowNumber], key, ignore);
CGSReleaseObj(key);
- CGSReleaseObj(ignore);
+ CGSReleaseObj(ignore);*/
+
+ CGSGetWindowTags([NSApp contextID], (CGSWindowID)[self windowNumber], &tags, 32);
+
+ if (flag) {
+ tags = tags | CGSTagTransparent;
+ } else {
+ tags = tags & CGSTagTransparent;
+ }
+
+ CGSSetWindowTags([NSApp contextID], (CGSWindowID)[self windowNumber], &tags, 32);
_reallyIgnoresEvents = flag;
}