summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 19:05:56 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 19:05:56 +0000
commita55598ecc43201c07ac8c2d016f4fcdd8979edcb (patch)
tree123dd85bdca1a7b78f3caac6421ef643034db9ef
parentfbe1347b202d9ed98d193305d37d765e3afd29be (diff)
downloadchromium_src-a55598ecc43201c07ac8c2d016f4fcdd8979edcb.zip
chromium_src-a55598ecc43201c07ac8c2d016f4fcdd8979edcb.tar.gz
chromium_src-a55598ecc43201c07ac8c2d016f4fcdd8979edcb.tar.bz2
Fix trackpad scrolling issues where scroll events with 0 were sent.
BUG=http://crbug.com/12283 TEST=as described in bug Review URL: http://codereview.chromium.org/159098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21300 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/api/src/mac/WebInputEventFactory.mm21
1 files changed, 12 insertions, 9 deletions
diff --git a/webkit/api/src/mac/WebInputEventFactory.mm b/webkit/api/src/mac/WebInputEventFactory.mm
index 262903c..02a85d2 100644
--- a/webkit/api/src/mac/WebInputEventFactory.mm
+++ b/webkit/api/src/mac/WebInputEventFactory.mm
@@ -1111,20 +1111,23 @@ WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(NSEvent* event, NSView*
// Wheel ticks are supposed to be raw, unaccelerated values, one per physical
// mouse wheel notch. The delta event is perfect for this (being a good
- // "specific edge case" as mentioned above). For trackpads, unfortunately, we
- // don't have anything better.
-
- result.wheelTicksY =
- CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis1);
- result.wheelTicksX =
- CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2);
+ // "specific edge case" as mentioned above). Trackpads, unfortunately, do
+ // event chunking, and sending mousewheel events with 0 ticks causes some
+ // websites to malfunction. Therefore, for all continuous input devices we use
+ // the point delta data instead, since we cannot distinguish trackpad data
+ // from data from any other continuous device.
if (CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventIsContinuous)) {
- result.deltaY =
+ result.wheelTicksY = result.deltaY =
CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventPointDeltaAxis1);
- result.deltaX =
+ result.wheelTicksX = result.deltaX =
CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventPointDeltaAxis2);
} else {
+ result.wheelTicksY =
+ CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis1);
+ result.wheelTicksX =
+ CGEventGetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2);
+
// Convert wheel delta amount to a number of pixels to scroll.
static const double scrollbarPixelsPerCocoaTick = 40.0;