From 2cb5f45a2769b6b9ccf25dec470f56b3ce9b1460 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Thu, 3 Jan 2013 09:44:19 +1300 Subject: [PATCH] b=821749 remove unnecessary mTransientParent r=roc --HG-- extra : transplant_source : %D9E%BD%F12%0E%B8U%EB%98%D3%B4%CD%D4%AC/%E5%A9%A6%05 --- widget/gtk2/nsWindow.cpp | 11 +++-------- widget/gtk2/nsWindow.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/widget/gtk2/nsWindow.cpp b/widget/gtk2/nsWindow.cpp index debebed35206..03b49b12c66e 100644 --- a/widget/gtk2/nsWindow.cpp +++ b/widget/gtk2/nsWindow.cpp @@ -360,7 +360,6 @@ nsWindow::nsWindow() mHasMappedToplevel = false; mIsFullyObscured = false; mRetryPointerGrab = false; - mTransientParent = nullptr; mWindowType = eWindowType_child; mSizeState = nsSizeMode_Normal; mLastSizeMode = nsSizeMode_Normal; @@ -767,8 +766,6 @@ nsWindow::SetParent(nsIWidget *aNewParent) return NS_ERROR_NOT_IMPLEMENTED; } - NS_ASSERTION(!mTransientParent, "child widget with transient parent"); - nsCOMPtr kungFuDeathGrip = this; if (mParent) { mParent->RemoveChild(this); @@ -822,12 +819,12 @@ nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) nsWindow* newParent = static_cast(aNewParent); GdkWindow* newParentWindow = newParent->mGdkWindow; GtkWidget* newContainer = newParent->GetMozContainerWidget(); + GtkWindow* shell = GTK_WINDOW(mShell); - if (mTransientParent) { + if (shell && gtk_window_get_transient_for(shell)) { GtkWindow* topLevelParent = GTK_WINDOW(gtk_widget_get_toplevel(newContainer)); - gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); - mTransientParent = topLevelParent; + gtk_window_set_transient_for(shell, topLevelParent); } ReparentNativeWidgetInternal(aNewParent, newContainer, newParentWindow, @@ -3429,7 +3426,6 @@ nsWindow::Create(nsIWidget *aParent, GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); - mTransientParent = topLevelParent; } else if (mWindowType == eWindowType_popup) { // With popup windows, we want to control their position, so don't @@ -3516,7 +3512,6 @@ nsWindow::Create(nsIWidget *aParent, if (topLevelParent) { gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); - mTransientParent = topLevelParent; } } else { // must be eWindowType_toplevel diff --git a/widget/gtk2/nsWindow.h b/widget/gtk2/nsWindow.h index 30d90d33b6a0..0bf01979fa90 100644 --- a/widget/gtk2/nsWindow.h +++ b/widget/gtk2/nsWindow.h @@ -350,7 +350,6 @@ private: uint32_t mHasMappedToplevel : 1, mIsFullyObscured : 1, mRetryPointerGrab : 1; - GtkWindow *mTransientParent; nsSizeMode mSizeState; PluginType mPluginType;