This commit is contained in:
Mats Palmgren 2010-04-11 02:14:55 +02:00
Родитель 7cbf4c2131
Коммит 6a2714943d
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -33,7 +33,7 @@
* Masayuki Nakano <masayuki@d-toybox.com> * Masayuki Nakano <masayuki@d-toybox.com>
* Dainis Jonitis <Dainis_Jonitis@swh-t.lv> * Dainis Jonitis <Dainis_Jonitis@swh-t.lv>
* Christian Biesinger <cbiesinger@web.de> * Christian Biesinger <cbiesinger@web.de>
* Mats Palmgren <mats.palmgren@bredband.net> * Mats Palmgren <matspal@gmail.com>
* Ningjie Chen <chenn@email.uc.edu> * Ningjie Chen <chenn@email.uc.edu>
* Jim Mathies <jmathies@mozilla.com> * Jim Mathies <jmathies@mozilla.com>
* Kyle Huey <me@kylehuey.com> * Kyle Huey <me@kylehuey.com>
@ -538,10 +538,12 @@ nsWindow::Create(nsIWidget *aParent,
aAppShell, aToolkit, aInitData); aAppShell, aToolkit, aInitData);
HWND parent; HWND parent;
if (nsnull != aParent) { // has a nsIWidget parent if (aParent) { // has a nsIWidget parent
parent = ((aParent) ? (HWND)aParent->GetNativeData(NS_NATIVE_WINDOW) : nsnull); parent = aParent ? (HWND)aParent->GetNativeData(NS_NATIVE_WINDOW) : NULL;
mParent = aParent;
} else { // has a nsNative parent } else { // has a nsNative parent
parent = (HWND)aNativeParent; parent = (HWND)aNativeParent;
mParent = aNativeParent ? GetNSWindowPtr((HWND)aNativeParent) : nsnull;
} }
if (nsnull != aInitData) { if (nsnull != aInitData) {
@ -1000,6 +1002,8 @@ BOOL nsWindow::SetNSWindowPtr(HWND aWnd, nsWindow * ptr)
// Get and set parent widgets // Get and set parent widgets
NS_IMETHODIMP nsWindow::SetParent(nsIWidget *aNewParent) NS_IMETHODIMP nsWindow::SetParent(nsIWidget *aNewParent)
{ {
mParent = aNewParent;
if (aNewParent) { if (aNewParent) {
nsCOMPtr<nsIWidget> kungFuDeathGrip(this); nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
@ -6191,6 +6195,7 @@ void nsWindow::OnDestroy()
// XXX Windows will take care of this in the proper order, and SetParent(nsnull)'s // XXX Windows will take care of this in the proper order, and SetParent(nsnull)'s
// remove child on the parent already took place in nsBaseWidget's Destroy call above. // remove child on the parent already took place in nsBaseWidget's Destroy call above.
//SetParent(nsnull); //SetParent(nsnull);
mParent = nsnull;
// We have to destroy the native drag target before we null out our window pointer. // We have to destroy the native drag target before we null out our window pointer.
EnableDragDrop(PR_FALSE); EnableDragDrop(PR_FALSE);

Просмотреть файл

@ -27,6 +27,7 @@
* Masayuki Nakano <masayuki@d-toybox.com> * Masayuki Nakano <masayuki@d-toybox.com>
* Ningjie Chen <chenn@email.uc.edu> * Ningjie Chen <chenn@email.uc.edu>
* Jim Mathies <jmathies@mozilla.com>. * Jim Mathies <jmathies@mozilla.com>.
* Mats Palmgren <matspal@gmail.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -420,6 +421,7 @@ protected:
#endif // ACCESSIBILITY #endif // ACCESSIBILITY
protected: protected:
nsCOMPtr<nsIWidget> mParent;
nsIntSize mLastSize; nsIntSize mLastSize;
nsIntPoint mLastPoint; nsIntPoint mLastPoint;
HWND mWnd; HWND mWnd;