Bug 422531 - "Add back code so as to not regress bug 395334 again" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr=roc a1.9=beltzner]
authorreed@reedloden.com
Fri, 14 Mar 2008 09:26:13 -0700
changeset 13078 9ea8962a1716f46755ca99ebe66ed173924c2b10
parent 13077 d74955a3f447ff56e979ff1bf578324e03672575
child 13079 3e389aa50b72f4e8c268411e3bef9fc0fafd19f0
push idunknown
push userunknown
push dateunknown
bugs422531, 395334
milestone1.9b5pre
Bug 422531 - "Add back code so as to not regress bug 395334 again" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r+sr=roc a1.9=beltzner]
widget/src/gtk2/nsWindow.cpp
--- a/widget/src/gtk2/nsWindow.cpp
+++ b/widget/src/gtk2/nsWindow.cpp
@@ -3118,18 +3118,26 @@ nsWindow::NativeCreate(nsIWidget        
                     mWindowGroup = parentnsWindow->mWindowGroup;
                     g_object_ref(G_OBJECT(mWindowGroup));
                     LOG(("adding window %p to group %p\n",
                          (void *)mShell, (void *)mWindowGroup));
                 }
             }
         }
         else if (mWindowType == eWindowType_popup) {
-            mShell = gtk_window_new(GTK_WINDOW_POPUP);
-            gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", cBrand.get());
+            // treat popups with a parent as top level windows
+            if (mParent) {
+                mShell = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+                gtk_window_set_wmclass(GTK_WINDOW(mShell), "Toplevel", cBrand.get());
+                gtk_window_set_decorated(GTK_WINDOW(mShell), FALSE);
+            }
+            else {
+                mShell = gtk_window_new(GTK_WINDOW_POPUP);
+                gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", cBrand.get());
+            }
 
             GdkWindowTypeHint gtkTypeHint;
             switch (aInitData->mPopupHint) {
                 case ePopupTypeMenu:
                     gtkTypeHint = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
                     break;
                 case ePopupTypeTooltip:
                     gtkTypeHint = GDK_WINDOW_TYPE_HINT_TOOLTIP;