Bug 1401195 - Make double-clicking draggable parts of the window always do the titlebar-double-click action, regardless of whether the click targeted the titlebar or some other draggable element. r=spohl

In the past there were cases where treating double click behavior differently from draggability
was necessary, but there don't seem to exist such cases any more. For example, we don't have any
windows with bottom bars / draggable status bars any more.
This change simplifies the code and frees the frontend from having to use special -moz-appearance
values to indicate titlebary parts of the window.

MozReview-Commit-ID: IRe3FPU2EaT

--HG--
extra : rebase_source : e52b79d4cbc15b3c3a70b8411c5917309a7f78d8
This commit is contained in:
Markus Stange 2018-03-09 14:41:50 -05:00
parent f572733682
commit 1211c84c8c

View File

@ -4596,14 +4596,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
bool defaultPrevented =
(mGeckoChild->DispatchInputEvent(&geckoEvent) == nsEventStatus_eConsumeNoDefault);
// Check to see if we are double-clicking in the titlebar.
CGFloat locationInTitlebar = [[self window] frame].size.height - [theEvent locationInWindow].y;
// Check to see if we are double-clicking in draggable parts of the window.
LayoutDeviceIntPoint pos = geckoEvent.mRefPoint;
if (!defaultPrevented && [theEvent clickCount] == 2 &&
!mGeckoChild->GetNonDraggableRegion().Contains(pos.x, pos.y) &&
[[self window] isKindOfClass:[ToolbarWindow class]] &&
(locationInTitlebar < [(ToolbarWindow*)[self window] titlebarHeight] ||
locationInTitlebar < [(ToolbarWindow*)[self window] unifiedToolbarHeight])) {
!mGeckoChild->GetNonDraggableRegion().Contains(pos.x, pos.y)) {
if ([self shouldZoomOnDoubleClick]) {
[[self window] performZoom:nil];
} else if ([self shouldMinimizeOnTitlebarDoubleClick]) {