summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 22:48:23 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-25 22:48:23 +0000
commit9ce6b959a4bf6a5c7d9743b27f748701f3953ccb (patch)
treea934fffda864a8613e03583e663d2207754758d0
parent5a91c39f06bef9aa493f2d642349b39341a2bb39 (diff)
downloadchromium_src-9ce6b959a4bf6a5c7d9743b27f748701f3953ccb.zip
chromium_src-9ce6b959a4bf6a5c7d9743b27f748701f3953ccb.tar.gz
chromium_src-9ce6b959a4bf6a5c7d9743b27f748701f3953ccb.tar.bz2
Improve wheel scrolling on Linux.
This was driving me nuts, so I just fixed it. We now behave more or less like Firefox. Review URL: http://codereview.chromium.org/28140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10394 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webinputevent_linux.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/webkit/glue/webinputevent_linux.cc b/webkit/glue/webinputevent_linux.cc
index f3323db..5c7efd5 100644
--- a/webkit/glue/webinputevent_linux.cc
+++ b/webkit/glue/webinputevent_linux.cc
@@ -115,8 +115,17 @@ WebMouseWheelEvent::WebMouseWheelEvent(const GdkEventScroll* event) {
type = MOUSE_WHEEL;
- // TODO(tc): Figure out what the right value for this is.
- static const int kWheelDelta = 1;
+ // How much should we scroll per mouse wheel event?
+ // - Windows uses 3 lines by default and obeys a system setting.
+ // - Mozilla has a pref that lets you either use the "system" number of lines
+ // to scroll, or lets the user override it.
+ // For the "system" number of lines, it appears they've hardcoded 3.
+ // See case NS_MOUSE_SCROLL in content/events/src/nsEventStateManager.cpp
+ // and InitMouseScrollEvent in widget/src/gtk2/nsCommonWidget.cpp .
+ // - Gtk makes the scroll amount a function of the size of the scroll bar,
+ // which is not available to us here.
+ // Instead, we pick a number that empirically matches Firefox's behavior.
+ static const int kWheelDelta = 4;
delta_x = 0;
delta_y = 0;