Bug 15108 - Wheel scrolling scrolls by too far in the GTK port
Summary: Wheel scrolling scrolls by too far in the GTK port
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-29 05:29 PDT by George Wright
Modified: 2007-10-20 16:05 PDT (History)
2 users (show)

See Also:


Attachments
Change scroll delta from 120 to 0.25 (1.66 KB, patch)
2007-10-20 14:44 PDT, Jasper Bryant-Greene
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Wright 2007-08-29 05:29:10 PDT
When scrolling with a mouse wheel the page scrolls by 4800 pixels which scrolls to either the very top of the page or the very bottom in most cases. This step needs to be smaller.
Comment 1 George Wright 2007-08-29 05:32:59 PDT
A look at WheelEventGdk.cpp and comparing it with WheelEventQt.cpp shows that deltaX and deltaY for the PlatformWheelEvent are being hard coded to 120 in the GTK port and are being set to some multiple or fraction of 15 degrees in the Qt port (Qt reports the wheel scroll event as the number of degrees the mouse wheel has rotated through, in eighths of a degree, and WheelEventQt.cpp divides this value by 120 - http://doc.trolltech.com/4.3/qwheelevent.html#delta).

When calling scrollBy(), this delta is multiplied by LINE_STEP which is hardcoded at 40 to give 4800 in the case of GTK.

Therefore I propose we hardcode deltaX/deltaY to something more sane in GTK like 0.25 instead of 120.
Comment 2 Jasper Bryant-Greene 2007-10-20 14:44:34 PDT
Created attachment 16746 [details]
Change scroll delta from 120 to 0.25

I've also moved the delta into a static const float at the start of the function.
Comment 3 Maciej Stachowiak 2007-10-20 15:59:58 PDT
Comment on attachment 16746 [details]
Change scroll delta from 120 to 0.25

r=me
Comment 4 Mark Rowe (bdash) 2007-10-20 16:05:18 PDT
Landed in r26835.