mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 347743 related fix: make SetParent actually change the parent of the widget. r+sr=roc.
This commit is contained in:
parent
3745d28e95
commit
1383db2cea
@ -1636,9 +1636,20 @@ NS_METHOD nsWindow::Destroy()
|
||||
NS_IMETHODIMP nsWindow::SetParent(nsIWidget *aNewParent)
|
||||
{
|
||||
if (aNewParent) {
|
||||
nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
|
||||
|
||||
nsIWidget* parent = GetParent();
|
||||
if (parent) {
|
||||
parent->RemoveChild(this);
|
||||
}
|
||||
|
||||
HWND newParent = (HWND)aNewParent->GetNativeData(NS_NATIVE_WINDOW);
|
||||
NS_ASSERTION(newParent, "Parent widget has a null native window handle");
|
||||
::SetParent(mWnd, newParent);
|
||||
if (newParent && mWnd) {
|
||||
::SetParent(mWnd, newParent);
|
||||
}
|
||||
|
||||
aNewParent->AddChild(this);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user