From 9c87c36644da3b66786bf094bb393cd1e024e5c0 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Thu, 30 Oct 2014 18:08:03 -0700 Subject: [PATCH] Fixed: refactoring of CPPlatformWindow --- AppKit/CPWindow/CPWindow.j | 4 ++-- AppKit/Platform/CPPlatformWindow.j | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index f0f941d09..babe6b074 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -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]; } diff --git a/AppKit/Platform/CPPlatformWindow.j b/AppKit/Platform/CPPlatformWindow.j index 9afe9e15d..4fe4da01b 100644 --- a/AppKit/Platform/CPPlatformWindow.j +++ b/AppKit/Platform/CPPlatformWindow.j @@ -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;