Skip to content

Instantly share code, notes, and snippets.

@jbking
Created January 3, 2010 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbking/268045 to your computer and use it in GitHub Desktop.
Save jbking/268045 to your computer and use it in GitHub Desktop.
diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j
index fc82ea3..86b1f58 100644
--- a/AppKit/CPWindow/CPWindow.j
+++ b/AppKit/CPWindow/CPWindow.j
@@ -176,6 +176,7 @@ CPWindowWillCloseNotification = @"CPWindowWillCloseNotification";
CPWindowDidBecomeMainNotification = @"CPWindowDidBecomeMainNotification";
CPWindowDidResignMainNotification = @"CPWindowDidResignMainNotification";
CPWindowDidMoveNotification = @"CPWindowDidMoveNotification";
+CPWindowDidResizeNotification = @"CPWindowDidResizeNotification";
CPWindowWillBeginSheetNotification = @"CPWindowWillBeginSheetNotification";
CPWindowDidEndSheetNotification = @"CPWindowDidEndSheetNotification";
CPWindowDidMiniaturizeNotification = @"CPWindowDidMiniaturizeNotification";
@@ -646,7 +647,7 @@ CPTexturedBackgroundWindowMask
[_shadowView setFrameSize:_CGSizeMake(SHADOW_MARGIN_LEFT + size.width + SHADOW_MARGIN_RIGHT, SHADOW_MARGIN_BOTTOM + size.height + SHADOW_MARGIN_TOP + SHADOW_DISTANCE)];
if (!_isAnimating && [_delegate respondsToSelector:@selector(windowDidResize:)])
- [_delegate windowDidResize:self];
+ [[CPNotificationCenter defaultCenter] postNotificationName:CPWindowDidResizeNotification object:self];
}
if ([self _sharesChromeWithPlatformWindow])
@@ -1028,6 +1029,13 @@ CPTexturedBackgroundWindowMask
selector:@selector(windowDidMove:)
name:CPWindowDidMoveNotification
object:self];
+
+ if ([_delegate respondsToSelector:@selector(windowDidResize:)])
+ [defaultCenter
+ addObserver:_delegate
+ selector:@selector(windowDidResize:)
+ name:CPWindowDidResizeNotification
+ object:self];
}
/*!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment