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

Unified Diff: webkit/glue/webinputevent_linux.cc

Issue 40135: Various fixes to mouse wheel scrolling:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
Index: webkit/glue/webinputevent_linux.cc
===================================================================
--- webkit/glue/webinputevent_linux.cc (revision 10933)
+++ webkit/glue/webinputevent_linux.cc (working copy)
@@ -103,6 +103,9 @@
}
WebMouseWheelEvent::WebMouseWheelEvent(const GdkEventScroll* event) {
+ type = MOUSE_WHEEL;
+ button = BUTTON_NONE;
+
timestamp_sec = GdkEventTimeToWebEventTime(event->time);
modifiers = GdkStateToWebEventModifiers(event->state);
x = static_cast<int>(event->x);
@@ -110,8 +113,6 @@
global_x = static_cast<int>(event->x_root);
global_y = static_cast<int>(event->y_root);
- type = MOUSE_WHEEL;
-
// 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
@@ -122,11 +123,10 @@
// - 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;
+ static const float kWheelDelta = 4;
delta_x = 0;
delta_y = 0;
-
switch (event->direction) {
case GDK_SCROLL_UP:
delta_y = kWheelDelta;
@@ -135,14 +135,15 @@
delta_y = -kWheelDelta;
break;
case GDK_SCROLL_LEFT:
- delta_x = -kWheelDelta;
+ delta_x = kWheelDelta;
break;
case GDK_SCROLL_RIGHT:
- delta_x = kWheelDelta;
+ delta_x = -kWheelDelta;
break;
default:
break;
}
+ scroll_by_page = false;
}
WebKeyboardEvent::WebKeyboardEvent(const GdkEventKey* event) {

Powered by Google App Engine
This is Rietveld 408576698