diff options
author | joshia@google.com <joshia@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-23 21:58:40 +0000 |
---|---|---|
committer | joshia@google.com <joshia@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-23 21:58:40 +0000 |
commit | b5d7cc7ad91885ed15fa285505d5eba283f193b7 (patch) | |
tree | d0beab2415dcccec8ebfaf0883fc834a29670524 /webkit/glue/webinputevent_win.cc | |
parent | 67b2505a94d723c7f6fb7814aefc677540d4fc7e (diff) | |
download | chromium_src-b5d7cc7ad91885ed15fa285505d5eba283f193b7.zip chromium_src-b5d7cc7ad91885ed15fa285505d5eba283f193b7.tar.gz chromium_src-b5d7cc7ad91885ed15fa285505d5eba283f193b7.tar.bz2 |
Fix scrolling when mouse wheel is set to scroll a page.
Bug=1520
Review URL: http://codereview.chromium.org/7929
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webinputevent_win.cc')
-rw-r--r-- | webkit/glue/webinputevent_win.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/webkit/glue/webinputevent_win.cc b/webkit/glue/webinputevent_win.cc index 6ca6292..b72bfc4 100644 --- a/webkit/glue/webinputevent_win.cc +++ b/webkit/glue/webinputevent_win.cc @@ -119,6 +119,13 @@ WebMouseWheelEvent::WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam, type = MOUSE_WHEEL; button = BUTTON_NONE; + // Add a simple workaround to scroll multiples units per page. + // The right fix needs to extend webkit's implementation of + // wheel events and that's not something we want to do at + // this time. See bug# 928509 + // TODO(joshia): Implement the right fix for bug# 928509 + const int kPageScroll = 10; // 10 times wheel scroll + UINT key_state = GET_KEYSTATE_WPARAM(wparam); int wheel_delta = static_cast<int>(GET_WHEEL_DELTA_WPARAM(wparam)); @@ -146,12 +153,6 @@ WebMouseWheelEvent::WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam, if (GetAsyncKeyState(VK_CONTROL)) key_state |= MK_CONTROL; - // Add a simple workaround to scroll multiples units per page. - // The right fix needs to extend webkit's implementation of - // wheel events and that's not something we want to do at - // this time. See bug# 928509 - // TODO(joshia): Implement the right fix for bug# 928509 - const int kPageScroll = 10; // 10 times wheel scroll switch (LOWORD(wparam)) { case SB_LINEUP: // == SB_LINELEFT wheel_delta = WHEEL_DELTA; @@ -211,8 +212,11 @@ WebMouseWheelEvent::WebMouseWheelEvent(HWND hwnd, UINT message, WPARAM wparam, unsigned long scroll_lines = kDefaultScrollLinesPerWheelDelta; SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0); - // TODO(darin): handle the case where scroll_lines is WHEEL_PAGESIZE int delta_lines = 0; + if (scroll_lines == WHEEL_PAGESCROLL) { + scroll_lines = kPageScroll; + } + if (scroll_lines == 0) { carryover = 0; } else { |