diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index b1039f76d..050fe36a5 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -257,6 +257,7 @@ var CPWindowSaveImage = nil, BOOL _hasShadow; BOOL _isMovableByWindowBackground; unsigned _shadowStyle; + BOOL _showsResizeIndicator; BOOL _isDocumentEdited; BOOL _isDocumentSaving; @@ -421,6 +422,8 @@ CPTexturedBackgroundWindowMask _defaultButtonEnabled = YES; _keyViewLoopIsDirty = YES; + + [self setShowsResizeIndicator:_styleMask & CPResizableWindowMask]; } return self; @@ -501,6 +504,7 @@ CPTexturedBackgroundWindowMask [_windowView addSubview:_contentView]; [_windowView setTitle:_title]; [_windowView noteToolbarChanged]; + [_windowView setShowsResizeIndicator:[self showsResizeIndicator]]; [self setFrame:[self frameRectForContentRect:contentRect]]; } @@ -794,7 +798,7 @@ CPTexturedBackgroundWindowMask */ - (BOOL)showsResizeIndicator { - return [_windowView showsResizeIndicator]; + return _showsResizeIndicator; } /*! @@ -802,8 +806,14 @@ CPTexturedBackgroundWindowMask @param shouldShowResizeIndicator \c YES sets the window to show its resize indicator. */ - (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator -{ - [_windowView setShowsResizeIndicator:shouldShowResizeIndicator]; +{ + shouldShowResizeIndicator = !!shouldShowResizeIndicator; + + if (_showsResizeIndicator === shouldShowResizeIndicator) + return; + + _showsResizeIndicator = shouldShowResizeIndicator; + [_windowView setShowsResizeIndicator:[self showsResizeIndicator]]; } /*! diff --git a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j index d21ec58f2..c86dd97e8 100644 --- a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j +++ b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j @@ -38,6 +38,11 @@ var _CPToolbarViewBackgroundColor = nil; return _CPToolbarViewBackgroundColor; } +- (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator +{ + // We don't ever want to show the resize indicator. +} + - (void)tile { [super tile]; diff --git a/AppKit/CPWindow/_CPWindowView.j b/AppKit/CPWindow/_CPWindowView.j index 0f878fd9a..67e1721c9 100644 --- a/AppKit/CPWindow/_CPWindowView.j +++ b/AppKit/CPWindow/_CPWindowView.j @@ -81,8 +81,6 @@ var _CPWindowViewResizeIndicatorImage = nil; _styleMask = aStyleMask; _resizeIndicatorOffset = CGSizeMake(0.0, 0.0); _toolbarOffset = CGSizeMake(0.0, 0.0); - - [self setShowsResizeIndicator:!(_styleMask & CPBorderlessBridgeWindowMask) && (_styleMask & CPResizableWindowMask)]; } return self; @@ -213,13 +211,13 @@ var _CPWindowViewResizeIndicatorImage = nil; [_resizeIndicator setImage:_CPWindowViewResizeIndicatorImage]; [_resizeIndicator setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin]; - + [self addSubview:_resizeIndicator]; } else { [_resizeIndicator removeFromSuperview]; - + _resizeIndicator = nil; } }