mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Issue #2362 - Fix click handling according to the spec.
This removes some hackery surrounding preventing content clicks, and in general handles auxclick as it should, firing that event on secondary buttons (wheel/right on default setup for right-handed mouse).
This commit is contained in:
parent
73bf6f95f8
commit
dc253ce953
8 changed files with 82 additions and 85 deletions
|
|
@ -4682,6 +4682,7 @@ EventStateManager::InitAndDispatchClickEvent(WidgetMouseEvent* aMouseUpEvent,
|
|||
event.buttons = aMouseUpEvent->buttons;
|
||||
event.mTime = aMouseUpEvent->mTime;
|
||||
event.mTimeStamp = aMouseUpEvent->mTimeStamp;
|
||||
event.mFlags.mOnlyChromeDispatch = aNoContentDispatch;
|
||||
event.mFlags.mNoContentDispatch = aNoContentDispatch;
|
||||
event.button = aMouseUpEvent->button;
|
||||
event.inputSource = aMouseUpEvent->inputSource;
|
||||
|
|
@ -4764,8 +4765,16 @@ EventStateManager::DispatchClickEvents(nsIPresShell* aPresShell,
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Fire auxclick even if necessary.
|
||||
if (fireAuxClick && aClickTarget && aClickTarget->IsInComposedDoc()) {
|
||||
ret = InitAndDispatchClickEvent(aMouseUpEvent, aStatus, eMouseAuxClick,
|
||||
aPresShell, aClickTarget, currentTarget,
|
||||
false);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(ret), "Failed to dispatch eMouseAuxClick");
|
||||
}
|
||||
|
||||
// Fire double click event if click count is 2.
|
||||
if (aMouseUpEvent->mClickCount == 2 &&
|
||||
if (aMouseUpEvent->mClickCount == 2 && !fireAuxClick &&
|
||||
aClickTarget && aClickTarget->IsInComposedDoc()) {
|
||||
ret = InitAndDispatchClickEvent(aMouseUpEvent, aStatus, eMouseDoubleClick,
|
||||
aPresShell, aClickTarget, currentTarget,
|
||||
|
|
@ -4775,15 +4784,6 @@ EventStateManager::DispatchClickEvents(nsIPresShell* aPresShell,
|
|||
}
|
||||
}
|
||||
|
||||
// Fire auxclick even if necessary.
|
||||
if (fireAuxClick &&
|
||||
aClickTarget && aClickTarget->IsInComposedDoc()) {
|
||||
ret = InitAndDispatchClickEvent(aMouseUpEvent, aStatus, eMouseAuxClick,
|
||||
aPresShell, aClickTarget, currentTarget,
|
||||
false);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(ret), "Failed to dispatch eMouseAuxClick");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue