Bug 449734 part 2 - Add the widget to the new parent's child list. r=roc a=blocking2.0:betaN
authorMats Palmgren <matspal@gmail.com>
Sat, 18 Sep 2010 13:28:50 +0200
changeset 54310 f0993738b5990be7d4277f9b2c0bae802d877906
parent 54309 8d3d6240f81e5930f34dae220aa99d10c35ce2e3
child 54311 587c3e3d00801b83fe8cbcf03181368c03b4a450
push id15843
push usermpalmgren@mozilla.com
push dateSat, 18 Sep 2010 11:29:47 +0000
treeherdermozilla-central@f1eec85dcfdc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking2
bugs449734
milestone2.0b7pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 449734 part 2 - Add the widget to the new parent's child list. r=roc a=blocking2.0:betaN
widget/src/gtk2/nsWindow.cpp
--- a/widget/src/gtk2/nsWindow.cpp
+++ b/widget/src/gtk2/nsWindow.cpp
@@ -837,17 +837,16 @@ nsWindow::GetDPI()
 NS_IMETHODIMP
 nsWindow::SetParent(nsIWidget *aNewParent)
 {
     if (mContainer || !mGdkWindow || !mParent) {
         NS_NOTREACHED("nsWindow::SetParent - reparenting a non-child window");
         return NS_ERROR_NOT_IMPLEMENTED;
     }
 
-    // nsBaseWidget::SetZIndex adds child widgets to the parent's list.
     nsCOMPtr<nsIWidget> kungFuDeathGrip = this;
     mParent->RemoveChild(this);
 
     mParent = aNewParent;
 
     GtkWidget* oldContainer = GetMozContainerWidget();
     if (!oldContainer) {
         // The GdkWindows have been destroyed so there is nothing else to
@@ -859,16 +858,17 @@ nsWindow::SetParent(nsIWidget *aNewParen
 
     NS_ABORT_IF_FALSE(!GDK_WINDOW_OBJECT(mGdkWindow)->destroyed,
                       "destroyed GdkWindow with widget");
 
     nsWindow* newParent = static_cast<nsWindow*>(aNewParent);
     GdkWindow* newParentWindow = NULL;
     GtkWidget* newContainer = NULL;
     if (aNewParent) {
+        aNewParent->AddChild(this);
         newParentWindow = newParent->mGdkWindow;
         if (newParentWindow) {
             newContainer = get_gtk_widget_for_gdk_window(newParentWindow);
         }
     } else {
         // aNewParent is NULL, but reparent to a hidden window to avoid
         // destroying the GdkWindow and its descendants.
         // An invisible container widget is needed to hold descendant