Menu

#11 Bugfix for scroll wheel issue

closed
nobody
None
5
2012-09-23
2011-09-11
David Hay
No

I noticed that after I installed Windows 7 64 bit, mouse wheel scrolling didn't work quite right in KDiff anymore. If I moved the wheel very fast I could get it to respond, but slow and steady moving of the wheel would never scroll the panes at all (unless I put the cursor directly over the scroll bar on the side, which I'm guessing uses a different scrolling protocol).

I checked the QT documentation and found the following about QWheelEvent->delta:

"Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees.

However, some mice have finer-resolution wheels and send delta values that are less than 120 units (less than 15 degrees). To support this possibility, you can either cumulatively add the delta values from events until the value of 120 is reached, then scroll the widget, or you can partially scroll the widget in response to each wheel event."

I checked out the source, and made their suggested change (cumulatively added the small delta values), and scrolling now works as it used to in all my testing. The docs talk about specific mice, but it must also have an OS component because this exact same mouse didn't exhibit this behavior in Vista for me.

This is actually my first patch contribution to SF, so let me know if I screwed up the process in making this. Thanks!

Discussion

  • David Hay

    David Hay - 2011-09-11

    patch to fix scroll wheel operation

     
  • Joachim Eibl

    Joachim Eibl - 2011-09-14

    Thanks for the patch. Looks nice. I already checked it in too. (svn Revision 146).
    Joachim