Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: webkit/glue/webinputevent_win.cc

Issue 43049: Fix horizontal scrolling to not be reversed on tilt wheel mice and old Thinkp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webinputevent_win.cc
===================================================================
--- webkit/glue/webinputevent_win.cc (revision 11352)
+++ webkit/glue/webinputevent_win.cc (working copy)
@@ -163,10 +163,8 @@
break;
}
- if (message == WM_HSCROLL) {
+ if (message == WM_HSCROLL)
horizontal_scroll = true;
- wheel_delta = -wheel_delta;
- }
} else {
// Non-synthesized event; we can just read data off the event.
get_key_state = GetKeyState;
@@ -176,10 +174,13 @@
global_y = static_cast<short>(HIWORD(lparam));
wheel_delta = static_cast<float>(GET_WHEEL_DELTA_WPARAM(wparam));
- if (((message == WM_MOUSEHWHEEL) || (key_state & MK_SHIFT)) &&
- (wheel_delta != 0))
+ if (message == WM_MOUSEHWHEEL) {
horizontal_scroll = true;
+ wheel_delta = -wheel_delta; // Windows is <- -/+ ->, WebKit <- +/- ->.
+ }
}
+ if (key_state & MK_SHIFT)
+ horizontal_scroll = true;
// Set modifiers based on key state.
if (key_state & MK_SHIFT)
@@ -223,7 +224,8 @@
}
}
- // Set scroll amount based on above calculations.
+ // Set scroll amount based on above calculations. WebKit expects positive
+ // delta_y to mean "scroll up" and positive delta_x to mean "scroll left".
if (horizontal_scroll) {
delta_x = scroll_delta;
delta_y = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698