Bug 287162 - Mac Widget code ignores "minimizable=no" window feature, r=mano sr=roc ui-r=faaborg
authorMarkus Amalthea Magnuson <markus.magnuson@gmail.com>
Sat, 17 Oct 2009 21:05:42 -0700
changeset 34238 8c32e0eecbad2f154294c67014ac9e09e26617d7
parent 34237 38b06fd30c16c4b2dc5b30a1a4d61dbe97c8e6a8
child 34239 a176eb500f882f5033e2609f07dff91f9edfe5d4
push id115
push userbmcbride@mozilla.com
push dateMon, 19 Oct 2009 23:27:00 +0000
reviewersmano, roc, faaborg
bugs287162
milestone1.9.3a1pre
Bug 287162 - Mac Widget code ignores "minimizable=no" window feature, r=mano sr=roc ui-r=faaborg
browser/base/content/utilityOverlay.js
widget/src/cocoa/nsCocoaWindow.mm
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -372,20 +372,18 @@ function openAboutDialog()
 {
 #ifdef XP_MACOSX
   var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                      .getService(Components.interfaces.nsIWindowMediator);
   var win = wm.getMostRecentWindow("Browser:About");
   if (win)
     win.focus();
   else {
-    // XXXmano: define minimizable=no although it does nothing on OS X
-    // (see Bug 287162); remove this comment once Bug 287162 is fixed...
-    window.open("chrome://browser/content/aboutDialog.xul", "About",
-                "chrome, resizable=no, minimizable=no");
+    window.openDialog("chrome://browser/content/aboutDialog.xul", "About",
+                      "chrome, resizable=no, minimizable=no");
   }
 #else
   window.openDialog("chrome://browser/content/aboutDialog.xul", "About", "centerscreen,chrome,resizable=no");
 #endif
 }
 
 function openPreferences(paneID, extraArgs)
 {
--- a/widget/src/cocoa/nsCocoaWindow.mm
+++ b/widget/src/cocoa/nsCocoaWindow.mm
@@ -261,19 +261,21 @@ static unsigned int WindowMaskForBorderS
   /* Apple's docs on NSWindow styles say that "a window's style mask should
    * include NSTitledWindowMask if it includes any of the others [besides
    * NSBorderlessWindowMask]".  This implies that a borderless window
    * shouldn't have any other styles than NSBorderlessWindowMask.
    */
   if (!allOrDefault && !(aBorderStyle & eBorderStyle_title))
     return NSBorderlessWindowMask;
 
-  unsigned int mask = NSTitledWindowMask | NSMiniaturizableWindowMask;
+  unsigned int mask = NSTitledWindowMask;
   if (allOrDefault || aBorderStyle & eBorderStyle_close)
     mask |= NSClosableWindowMask;
+  if (allOrDefault || aBorderStyle & eBorderStyle_minimize)
+    mask |= NSMiniaturizableWindowMask;
   if (allOrDefault || aBorderStyle & eBorderStyle_resizeh)
     mask |= NSResizableWindowMask;
 
   return mask;
 }
 
 // If aRectIsFrameRect, aRect specifies the frame rect of the new window.
 // Otherwise, aRect.x/y specify the position of the window's frame relative to