Bug 881713 - Use onClick: for double-click actions in drawInTitlebar windows. r=smichaud
authorJosiahOne <josiah@programmer.net>
Tue, 11 Jun 2013 13:33:32 -0400
changeset 134680 4e0f0d13afd3c731de78aa74625fa6a38a3d9d98
parent 134679 9c6f5f334a15584a1b3749ca55505105d22c6486
child 134681 d038d584102c8535594fa6da75dfad2bb81484c5
push id29328
push userryanvm@gmail.com
push dateTue, 11 Jun 2013 19:10:04 +0000
treeherdermozilla-inbound@4e0f0d13afd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs881713
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 881713 - Use onClick: for double-click actions in drawInTitlebar windows. r=smichaud
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4097,17 +4097,19 @@ NSEvent* gLastDragMouseDownEvent = nil;
   // Check to see if we are double-clicking in the titlebar.
   CGFloat locationInTitlebar = [[self window] frame].size.height - [theEvent locationInWindow].y;
   if (!defaultPrevented && [theEvent clickCount] == 2 &&
       [[self window] isMovableByWindowBackground] &&
       [self shouldMinimizeOnTitlebarDoubleClick] &&
       [[self window] isKindOfClass:[ToolbarWindow class]] &&
       (locationInTitlebar < [(ToolbarWindow*)[self window] titlebarHeight] ||
        locationInTitlebar < [(ToolbarWindow*)[self window] unifiedToolbarHeight])) {
-    [[self window] miniaturize:self];
+
+    NSButton *minimizeButton = [[self window] standardWindowButton:NSWindowMiniaturizeButton];
+    [minimizeButton performClick:self];
   }
 
   // If our mouse-up event's location is over some other object (as might
   // happen if it came at the end of a dragging operation), also send our
   // Gecko frame a mouse-exit event.
   if (mGeckoChild && mIsPluginView) {
     if (mPluginEventModel == NPEventModelCocoa) {
       if (ChildViewMouseTracker::ViewForEvent(theEvent) != self) {