Fix for setting a new platform window on a visisble window throwing a DOM exception.

This commit is contained in:
Randall Luecke committed 2011-05-01 21:01:13 -04:00
1 parent 0f88207d7b
commit cd05d30f86
1 file changed
+15 -1
+15 -1
View File
@@ -466,12 +466,26 @@ CPTexturedBackgroundWindowMask
return _platformWindow;
}
/*!
Sets the platform window of the reciver.
This method will first close the reciever,
change the platform window, then reopen the window (if it was originally open).
*/
- (void)setPlatformWindow:(CPPlatformWindow)aPlatformWindow
{
// FIXME: already visible.
var wasVisible = [self isVisible];
// we have to close it first, otherwise we get a DOM exception.
if (wasVisible)
[self close];
_platformWindow = aPlatformWindow;
if (wasVisible)
[self orderFront:self];
}
/*!
@ignore
*/