mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-05 00:22:58 +00:00
Fixed: crash when opening a platformWindow with a popup blocker
Previously, when opening a CPPlatformWindow a crash happened when this new window was blocked by the browser (addblock, or browser feature). Now when opening an external window, we check if the DOMWindow has been created. This PR has modified the method isVisible of CPPlatformWindow. We now check if the _DOMWindow is not NULL and undefined.
This commit is contained in:
1 parent
ea37bf8b45
commit
40a9f19352
2 files changed
+7
-1
No files matched your search
@@ -213,7 +213,7 @@ var PrimaryPlatformWindow = NULL;
|
||||
- (BOOL)isVisible
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
return _DOMWindow !== NULL;
|
||||
return _DOMWindow !== NULL && _DOMWindow !== undefined;
|
||||
#else
|
||||
return NO;
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user