Bug 1445131 - When testing the event's position against the window's draggable region, read the position when it's still in the correct coordinate space. r=spohl

MozReview-Commit-ID: HqnXgIjDWrW

--HG--
extra : rebase_source : 9baf99dd7fc3715b7e7bedeea72fbe2b3728766d
This commit is contained in:
Markus Stange 2018-03-14 17:04:49 -04:00
Родитель 64686b0cbf
Коммит e890cbae46
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -4593,12 +4593,15 @@ NSEvent* gLastDragMouseDownEvent = nil;
else
geckoEvent.button = WidgetMouseEvent::eLeftButton;
// Remember the event's position before calling DispatchInputEvent, because
// that call can mutate it and convert it into a different coordinate space.
LayoutDeviceIntPoint pos = geckoEvent.mRefPoint;
// This might destroy our widget (and null out mGeckoChild).
bool defaultPrevented =
(mGeckoChild->DispatchInputEvent(&geckoEvent) == nsEventStatus_eConsumeNoDefault);
// 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)) {
if ([self shouldZoomOnDoubleClick]) {