bug 401793. only top-level windows should be able to get unified toolbar window style. r=josh, sr=roc, a=blocking1.9+

This commit is contained in:
hwaara@gmail.com 2007-11-17 04:49:04 -08:00
parent 6773c0a0f2
commit c5e9ea29f6

View File

@ -320,10 +320,11 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
// rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
Class windowClass = [NSWindow class];
// If we have a titlebar, we want to be able to control the titlebar color
// (for unified), so use the special ToolbarWindow class. Note that we need
// to check the window type because we mark sheets sheets as having titlebars.
if ((mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) &&
// If we have a titlebar on a top-level window, we want to be able to control the
// titlebar color (for unified windows), so use the special ToolbarWindow class.
// Note that we need to check the window type because we mark sheets sheets as
// having titlebars.
if (mWindowType == eWindowType_toplevel &&
(features & NSTitledWindowMask))
windowClass = [ToolbarWindow class];
// If we're a popup window we need to use the PopupWindow class.