mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987718 - Part 4: Send MOZ_LONGTAP event when long tap fired; r=bugs
This commit is contained in:
parent
89567c331d
commit
4ef0876bc3
@ -479,7 +479,7 @@ TabChildBase::DispatchSynthesizedMouseEvent(uint32_t aMsg, uint64_t aTime,
|
||||
nsIWidget* aWidget)
|
||||
{
|
||||
MOZ_ASSERT(aMsg == NS_MOUSE_MOVE || aMsg == NS_MOUSE_BUTTON_DOWN ||
|
||||
aMsg == NS_MOUSE_BUTTON_UP);
|
||||
aMsg == NS_MOUSE_BUTTON_UP || aMsg == NS_MOUSE_MOZLONGTAP);
|
||||
|
||||
WidgetMouseEvent event(true, aMsg, nullptr,
|
||||
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
|
||||
@ -691,6 +691,7 @@ TabChild::TabChild(ContentChild* aManager, const TabContext& aContext, uint32_t
|
||||
, mOrientation(eScreenOrientation_PortraitPrimary)
|
||||
, mUpdateHitRegion(false)
|
||||
, mContextMenuHandled(false)
|
||||
, mLongTapEventHandled(false)
|
||||
, mWaitingTouchListeners(false)
|
||||
, mIgnoreKeyPressEvent(false)
|
||||
, mActiveElementManager(new ActiveElementManager())
|
||||
@ -1739,7 +1740,17 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& a
|
||||
2, 1, 0, false,
|
||||
nsIDOMMouseEvent::MOZ_SOURCE_TOUCH);
|
||||
|
||||
SendContentReceivedTouch(aGuid, mContextMenuHandled);
|
||||
// If no one handle context menu, fire MOZLONGTAP event
|
||||
if (!mContextMenuHandled) {
|
||||
LayoutDevicePoint currentPoint =
|
||||
APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid) * mWidget->GetDefaultScale();
|
||||
int time = 0;
|
||||
nsEventStatus status =
|
||||
DispatchSynthesizedMouseEvent(NS_MOUSE_MOZLONGTAP, time, currentPoint, mWidget);
|
||||
mLongTapEventHandled = (status == nsEventStatus_eConsumeNoDefault);
|
||||
}
|
||||
|
||||
SendContentReceivedTouch(aGuid, mContextMenuHandled || mLongTapEventHandled);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1752,6 +1763,11 @@ TabChild::RecvHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid&
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mLongTapEventHandled) {
|
||||
mLongTapEventHandled = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
RecvHandleSingleTap(aPoint, aGuid);
|
||||
return true;
|
||||
}
|
||||
|
@ -561,6 +561,7 @@ private:
|
||||
ScreenOrientation mOrientation;
|
||||
bool mUpdateHitRegion;
|
||||
bool mContextMenuHandled;
|
||||
bool mLongTapEventHandled;
|
||||
bool mWaitingTouchListeners;
|
||||
void FireSingleTapEvent(LayoutDevicePoint aPoint);
|
||||
|
||||
|
@ -136,6 +136,7 @@ enum nsEventStructType
|
||||
#define NS_MOUSE_MOZHITTEST (NS_MOUSE_MESSAGE_START + 33)
|
||||
#define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34)
|
||||
#define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35)
|
||||
#define NS_MOUSE_MOZLONGTAP (NS_MOUSE_MESSAGE_START + 36)
|
||||
|
||||
// Pointer spec events
|
||||
#define NS_POINTER_EVENT_START 4400
|
||||
|
Loading…
Reference in New Issue
Block a user