Skip to content

Commit

Permalink
Update flags
Browse files Browse the repository at this point in the history
  • Loading branch information
alcor committed May 18, 2012
1 parent af5ccdf commit 5f2511a
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions QSNocturneController.m
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ - (void)setupOverlays{

//OSX 10.4 compatible code that puts the overlays on all spaces
// replacement for the line commented out below
if ([overlayWindow respondsToSelector:@selector(setCollectionBehavior:)]) {
[overlayWindow setCollectionBehavior:1 | 16];
}
// if ([overlayWindow respondsToSelector:@selector(setCollectionBehavior:)]) {
// [overlayWindow setCollectionBehavior:1 | 16];
// }
//This line is OSX 10.5 specific.
//[overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
[overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];

[overlayWindows addObject:overlayWindow];
} else {
Expand Down Expand Up @@ -629,8 +629,34 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
}
}

- (void)awakeFromNib{
- (void)windowDidEnterFullScreen:(NSNotification *)notification {

NSLog(@"blah");
}

- (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window {
NSLog(@"blah");

}


- (void)workspaceChanged:(NSNotification *)notif {
int currentSpace;
// get an array of all the windows in the current Space
CFArrayRef windowsInSpace = CGWindowListCopyWindowInfo(kCGWindowListOptionAll | kCGWindowListOptionOnScreenOnly, kCGNullWindowID);

// now loop over the array looking for a window with the kCGWindowWorkspace key
for (NSMutableDictionary *thisWindow in (NSArray *)windowsInSpace)
{
if ([thisWindow objectForKey:(id)kCGWindowWorkspace])
{
currentSpace = [[thisWindow objectForKey:(id)kCGWindowWorkspace] intValue];
break;
}
}
}
- (void)awakeFromNib{
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(workspaceChanged:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
[prefsWindow setBackgroundColor:[NSColor whiteColor]];
[prefsWindow setLevel:NSFloatingWindowLevel];
[prefsWindow setHidesOnDeactivate:NO];
Expand All @@ -648,16 +674,17 @@ - (void)awakeFromNib{
rect = NSMakeRect(0,NSMaxY(rect)-22,NSWidth(rect),22);

menuWindow = [[NSWindow alloc]initWithContentRect:rect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
[menuWindow setBackgroundColor: [NSColor blackColor]];
[menuWindow setBackgroundColor: [NSColor redColor]];
[menuWindow setOpaque:NO];
[menuWindow setAlphaValue:0.9];
[menuWindow setCanHide:NO];
[menuWindow setAllowsToolTipsWhenApplicationIsInactive:YES];
[menuWindow setIgnoresMouseEvents:YES];
[menuWindow setHasShadow:NO];
[menuWindow setDelegate:self];
[menuWindow setLevel:kCGStatusWindowLevel+2];
[menuWindow setCollectionBehavior:1 | 16];
[menuWindow setSticky:YES];
[menuWindow setCollectionBehavior: NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle];
// [menuWindow setSticky:YES];
//[window setDelegate:[window contentView]]];
NSTrackingArea *area = [[[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingEnabledDuringMouseDrag |NSTrackingActiveAlways
owner:self userInfo:nil] autorelease];
Expand Down Expand Up @@ -732,13 +759,13 @@ - (void)createOverlays {
[menuHueOverlay setLevel:kCGStatusWindowLevel+1];
[menuHueOverlay setFilter:@"CIHueAdjust"];
[menuHueOverlay setFilterValues:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:M_PI], @"inputAngle",nil]];
[menuHueOverlay setCollectionBehavior:1 | 16];
[menuHueOverlay setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle];
[menuHueOverlay setSticky:YES];

menuInvertOverlay = [[QSCIFilterWindow alloc] init];
[menuInvertOverlay setLevel:kCGStatusWindowLevel+1];
[menuInvertOverlay setFilter:@"CIColorInvert"];
[menuInvertOverlay setCollectionBehavior:1 | 16];
[menuInvertOverlay setCollectionBehavior:NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorIgnoresCycle];
[menuInvertOverlay setSticky:YES];

[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(endTracking) name:@"com.apple.HIToolbox.endMenuTrackingNotification" object:nil];
Expand Down

0 comments on commit 5f2511a

Please sign in to comment.