mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-10-31 15:05:46 +00:00
tune up scroll wheel events while we're at it
This commit is contained in:
parent
41e8326d1b
commit
5337274e15
@ -6029,12 +6029,19 @@ PanGestureTypeForEvent(NSEvent* aEvent)
|
|||||||
{
|
{
|
||||||
[self convertCocoaMouseEvent:aMouseEvent toGeckoEvent:outWheelEvent];
|
[self convertCocoaMouseEvent:aMouseEvent toGeckoEvent:outWheelEvent];
|
||||||
|
|
||||||
|
#ifdef __LP64__
|
||||||
bool usePreciseDeltas = nsCocoaUtils::HasPreciseScrollingDeltas(aMouseEvent) &&
|
bool usePreciseDeltas = nsCocoaUtils::HasPreciseScrollingDeltas(aMouseEvent) &&
|
||||||
Preferences::GetBool("mousewheel.enable_pixel_scrolling", true);
|
Preferences::GetBool("mousewheel.enable_pixel_scrolling", true);
|
||||||
|
|
||||||
outWheelEvent->deltaMode = usePreciseDeltas ? nsIDOMWheelEvent::DOM_DELTA_PIXEL
|
outWheelEvent->deltaMode = usePreciseDeltas ? nsIDOMWheelEvent::DOM_DELTA_PIXEL
|
||||||
: nsIDOMWheelEvent::DOM_DELTA_LINE;
|
: nsIDOMWheelEvent::DOM_DELTA_LINE;
|
||||||
outWheelEvent->isMomentum = nsCocoaUtils::IsMomentumScrollEvent(aMouseEvent);
|
outWheelEvent->isMomentum = nsCocoaUtils::IsMomentumScrollEvent(aMouseEvent);
|
||||||
|
#else
|
||||||
|
// Pixel scrolling and phases/momentum aren't supported until 10.7.
|
||||||
|
// We don't support 10.7, so let's save some overhead.
|
||||||
|
outWheelEvent->deltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE;
|
||||||
|
outWheelEvent->isMomentum = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent
|
- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent
|
||||||
|
Loading…
Reference in New Issue
Block a user