diff --git a/AppKit/Platform/CPPlatformWindow.j b/AppKit/Platform/CPPlatformWindow.j index fb742b351..de2080bcc 100644 --- a/AppKit/Platform/CPPlatformWindow.j +++ b/AppKit/Platform/CPPlatformWindow.j @@ -213,7 +213,7 @@ var PrimaryPlatformWindow = NULL; - (BOOL)isVisible { #if PLATFORM(DOM) - return _DOMWindow !== NULL; + return _DOMWindow !== NULL && _DOMWindow !== undefined; #else return NO; #endif diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index e96a5708c..bb183bd99 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -568,6 +568,9 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio _DOMWindow = window.open("about:blank", "_blank", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no,left=" + CGRectGetMinX(_contentRect) + ",top=" + CGRectGetMinY(_contentRect) + ",width=" + CGRectGetWidth(_contentRect) + ",height=" + CGRectGetHeight(_contentRect)); + if (!_DOMWindow) + return; + [PlatformWindows addObject:self]; // FIXME: cpSetFrame? @@ -1414,6 +1417,9 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio - (void)order:(CPWindowOrderingMode)orderingMode window:(CPWindow)aWindow relativeTo:(CPWindow)otherWindow { + if (!_DOMWindow) + return; + [CPPlatform initializeScreenIfNecessary]; // Grab the appropriate level for the layer, and create it if