adium 4502:a4baa271077e: Burninated -isOnCurrentWorkspace, the c...

commits at adium.im commits at adium.im
Fri Jan 13 01:10:11 UTC 2012


details:	http://hg.adium.im/adium/rev/a4baa271077e
revision:	4502:a4baa271077e
branch:		(none)
author:		Peter Hosey <hg at boredzo.org>
date:		Thu Jan 12 17:09:55 2012 -0800

Burninated -isOnCurrentWorkspace, the category method we had for compatibility with versions of Mac OS X older than Snow Leopard.

diffs (76 lines):

diff -r d89a91f84fcb -r a4baa271077e Frameworks/AIUtilities Framework/Source/AISmoothTooltipTracker.m
--- a/Frameworks/AIUtilities Framework/Source/AISmoothTooltipTracker.m	Thu Jan 12 18:52:59 2012 -0600
+++ b/Frameworks/AIUtilities Framework/Source/AISmoothTooltipTracker.m	Thu Jan 12 17:09:55 2012 -0800
@@ -40,10 +40,6 @@
 - (void)contentViewBoundsDidChange;
 @end
 
- at interface NSWindow (SpacesDeterminationHackery)
-- (BOOL)isOnCurrentWorkspace;
- at end
-
 @implementation AISmoothTooltipTracker
 
 + (AISmoothTooltipTracker *)smoothTooltipTrackerForView:(NSView *)inView withDelegate:(id <AISmoothTooltipTrackerDelegate>)inDelegate
@@ -291,7 +287,7 @@
 	
 	if ([theWindow isVisible] && 
 	   NSPointInRect([theWindow convertScreenToBase:mouseLocation],[[theWindow contentView] convertRect:[view frame] fromView:[view superview]]) &&
-		[theWindow isOnCurrentWorkspace]) {
+		[theWindow isOnActiveSpace]) {
 		//tooltipCount is used for delaying the appearence of tooltips.  We reset it to 0 when the mouse moves.  When
 		//the mouse is left still tooltipCount will eventually grow greater than TOOL_TIP_DELAY, and we will begin
 		//displaying the tooltips
@@ -324,52 +320,3 @@
 }
 
 @end
-
- at implementation NSWindow (SpacesDeterminationHackery)
-
-// Internal CoreGraphics typedefs
-typedef int	CGSConnection;
-typedef int	CGSWindow;
-
-/* Retrieve the workspace number associated with the workspace currently
- * being shown.
- *
- * cid -- Current connection.
- * workspace -- Pointer to int value to be set to workspace number.
- */
-extern OSStatus CGSGetWorkspace(const CGSConnection cid, int *workspace);
-
-/* Retrieve workspace number associated with the workspace a particular window
- * resides on.
- *
- * cid -- Current connection.
- * wid -- Window number of window to examine.
- * workspace -- Pointer to int value to be set to workspace number.
- */
-extern OSStatus CGSGetWindowWorkspace(const CGSConnection cid, const CGSWindow wid, int *workspace);
-
-/* Get the default connection for the current process. */
-extern CGSConnection _CGSDefaultConnection(void);
-
-- (BOOL)isOnCurrentWorkspace
-{
-	if ([self respondsToSelector:@selector(isOnActiveSpace)])
-		return [self isOnActiveSpace];
-
-	OSStatus err;
-	int currentWorkspace, windowWorkspace;
-
-	err = CGSGetWorkspace(_CGSDefaultConnection(), &currentWorkspace);
-	if (err == kCGErrorSuccess) {
-		CGSGetWindowWorkspace(_CGSDefaultConnection(), (int)[self windowNumber], &windowWorkspace);
-		if (err == kCGErrorSuccess) {
-			//If windowWorkspace is 0, the window is showing on every workspace, so it definitely is on the current one.
-			return ((currentWorkspace == windowWorkspace) || (windowWorkspace == 0));
-		}
-	}
-	
-	//Default to assuming that we're on the current workspace
-	return YES;
-}
-
- at end




More information about the commits mailing list