forked from mirrors/gecko-dev
Bug 1892537 - Set mIsPrimary by pointer ID only for touch input a=RyanVM
It only make sense for touch input, as touch pointer ID always restarts from 0 while pen pointer ID always increments. This won't work if there are multiple active pens, but that's rare enough and not straightforward to fix as somehow sActivePointersIds gets pointerId=0 instead of actual pointer ID for pens. Original Revision: https://phabricator.services.mozilla.com/D214978 Differential Revision: https://phabricator.services.mozilla.com/D219698
This commit is contained in:
parent
8dc476b8d0
commit
e3844abe87
1 changed files with 8 additions and 4 deletions
|
|
@ -564,10 +564,14 @@ void PointerEventHandler::InitPointerEventFromTouch(
|
|||
? aTouchEvent.mButtons
|
||||
: MouseButtonsFlag::ePrimaryFlag;
|
||||
|
||||
// Only the first touch would be the primary pointer.
|
||||
aPointerEvent.mIsPrimary = aTouchEvent.mMessage == eTouchStart
|
||||
? !HasActiveTouchPointer()
|
||||
: GetPointerPrimaryState(aTouch.Identifier());
|
||||
// XXX: This doesn't support multi pen scenario (bug 1904865)
|
||||
if (aTouchEvent.mInputSource == MouseEvent_Binding::MOZ_SOURCE_TOUCH) {
|
||||
// Only the first touch would be the primary pointer.
|
||||
aPointerEvent.mIsPrimary =
|
||||
aTouchEvent.mMessage == eTouchStart
|
||||
? !HasActiveTouchPointer()
|
||||
: GetPointerPrimaryState(aTouch.Identifier());
|
||||
}
|
||||
aPointerEvent.pointerId = aTouch.Identifier();
|
||||
aPointerEvent.mRefPoint = aTouch.mRefPoint;
|
||||
aPointerEvent.mModifiers = aTouchEvent.mModifiers;
|
||||
|
|
|
|||
Loading…
Reference in a new issue