Fixed: refactoring of CPPlatformWindow

This commit is contained in:
Alexandre Wilhelm
2014-10-30 18:08:03 -07:00
parent be9f5ad951
commit 9c87c36644
2 changed files with 8 additions and 3 deletions
+2 -2
View File
@@ -569,7 +569,7 @@ CPTexturedBackgroundWindowMask
var fullPlatformWindowViewClass = [[self class] _windowViewClassForFullPlatformWindowStyleMask:_styleMask],
windowView = [[fullPlatformWindowViewClass alloc] initWithFrame:CGRectMakeZero() styleMask:_styleMask];
if (_platformWindow != [CPPlatformWindow primaryPlatformWindow] && _platformWindow._hasInitializeInstanceWithWindow)
if (_platformWindow != [CPPlatformWindow primaryPlatformWindow] && [_platformWindow _hasInitializeInstanceWithWindow])
[_platformWindow setContentRect:[self frame]];
[self _setWindowView:windowView];
@@ -757,7 +757,7 @@ CPTexturedBackgroundWindowMask
[self _moveChildWindows:delta];
}
if ([_platformWindow _shouldUpdateContentRect] && _isFullPlatformWindow && _platformWindow != [CPPlatformWindow primaryPlatformWindow])
if ([_platformWindow _canUpdateContentRect] && _isFullPlatformWindow && _platformWindow != [CPPlatformWindow primaryPlatformWindow])
[_platformWindow setContentRect:aFrame];
}
+6 -1
View File
@@ -294,12 +294,17 @@ var PrimaryPlatformWindow = NULL;
return _title;
}
- (BOOL)_shouldUpdateContentRect
- (BOOL)_canUpdateContentRect
{
// We onyl update the contentRect with the frame of the bridgeless window if we have initialized the platform with the method initWithWindow:
return _shouldUpdateContentRect && _hasInitializeInstanceWithWindow;
}
- (BOOL)_hasInitializeInstanceWithWindow
{
return _hasInitializeInstanceWithWindow;
}
- (void)_setShouldUpdateContentRect:(BOOL)aBoolean
{
_shouldUpdateContentRect = aBoolean;