never assign a mozarea to mMozArea unless you own it.

git-svn-id: svn://10.0.0.236/branches/SUPERWIN@52853 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blizzard%redhat.com
1999-11-05 15:49:31 +00:00
parent f16eb3c3d2
commit 2cff6771cb
2 changed files with 23 additions and 13 deletions

View File

@@ -64,6 +64,7 @@ nsWindow::nsWindow()
mFont = nsnull;
mSuperWin = 0;
mMozArea = 0;
mMozAreaClosestParent = 0;
mMenuBar = nsnull;
mIsTooSmall = PR_FALSE;
@@ -1915,20 +1916,28 @@ nsWindow::GetMozArea()
GdkWindow *parent = mSuperWin->shell_window;
GtkWidget *widget;
if (mMozArea == nsnull)
while (parent)
{
gdk_window_get_user_data (parent, (void **)&widget);
if (widget != nsnull && GTK_IS_MOZAREA (widget))
{
mMozArea = widget;
break;
}
parent = gdk_window_get_parent (parent);
parent = gdk_window_get_parent (parent);
}
if (mMozAreaClosestParent)
{
return (GtkWidget *)mMozAreaClosestParent;
}
if ((mMozAreaClosestParent == nsnull) && mMozArea)
{
mMozAreaClosestParent = mMozArea;
return (GtkWidget *)mMozAreaClosestParent;
}
while (parent)
{
gdk_window_get_user_data (parent, (void **)&widget);
if (widget != nsnull && GTK_IS_MOZAREA (widget))
{
mMozAreaClosestParent = widget;
break;
}
parent = gdk_window_get_parent (parent);
parent = gdk_window_get_parent (parent);
}
return (GtkWidget *)mMozArea;
return (GtkWidget *)mMozAreaClosestParent;
}

View File

@@ -169,6 +169,7 @@ protected:
GtkWidget *mShell; /* used for toplevel windows */
GdkSuperWin *mSuperWin;
GtkWidget *mMozArea;
GtkWidget *mMozAreaClosestParent;
nsIMenuBar *mMenuBar;
private: