  - (void)retarget:(nsColorPicker*)aPicker;
  - (void)colorChanged:(NSColorPanel*)aPanel;
  @end
-@@ -52,14 +56,15 @@ HexStrToInt(NSString* str)
+@@ -52,14 +56,16 @@ HexStrToInt(NSString* str)
    return self;
  }
  

 };
 
diff --git a/widget/cocoa/nsColorPicker.mm b/widget/cocoa/nsColorPicker.mm
index 1fdaa03a29fb..be2e141052c5 100644
--- a/widget/cocoa/nsColorPicker.mm
+++ b/widget/cocoa/nsColorPicker.mm
@@ -9,6 +9,10 @@

   [mColorPanel setTitle:aTitle];
-  [mColorPanel setColor:aInitialColor];
   [mColorPanel setTarget:self];
-  [mColorPanel setAction:@selector(colorChanged:)];
+  [mColorPanel setShowsAlpha:aShowsAlpha];
   [mColorPanel setDelegate:self];
-  [mColorPanel makeKeyAndOrderFront:nil];
+  [mColorPanel orderFront:nil];
+  [mColorPanel setAction:nil];
+  [mColorPanel setColor:aInitialColor];
+  [mColorPanel setAction:@selector(colorChanged:)];
 }
 
 - (void)colorChanged:(NSColorPanel*)aPanel
@@ -103,12 +109,13 @@ nsColorPicker::~nsColorPicker()
 
 NS_IMETHODIMP
 nsColorPicker::Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
