GTK2 scroll bars jump to the bottom position when scrolling the mouse wheel up when at the top
Original Reporter info from Mantis: chiizujin
-
Reporter name:
Original Reporter info from Mantis: chiizujin
- Reporter name:
Description:
When a vertical scroll bar is positioned at its top-most position and the mouse wheel is scrolled upwards while over the scroll bar, the scroll bar (and contents of the component) jumps to its bottom-most position.
Similar behaviour happens for horizontal scroll bars scrolling left.
Steps to reproduce:
- Place a TGrid on a form and set its RowCount high enough to require a vertical
scroll bar.
- Run the application.
- Position the scroll bar to its top-most position either by dragging or
using the arrows on the scroll bar. It should be here anyway by default.
- Position the mouse pointer over the scroll bar.
- Scroll the wheel to move the scroll bar up.
Additional information:
This only occurs when scrolling with the mouse wheel while the mouse is over the scroll bar. It does not occur while using the scroll bar arrows, dragging the scroll bar or using the mouse wheel with the mouse over the component itself.
The behaviour can also be seen in the Lazarus IDE in windows such as the code editor and object inspector.
This is caused by the range check at line 3108 in the function Gtk2RangeScrollCB in gtk2callback.inc. If the range check fails it always positions the scroll bar at its maximum position, even in the case of a negative value (e.g. scrolling up when at the top).
A patch to fix this is attached.
This only affects some components, such as:
- TGrid
- TTreeView
- TSynEdit
Some controls not affected (they do not call Gtk2RangeScrollCB):
- TMemo
- TList
Also, bug 0019843 may be related to this, but I couldn't reproduce that bug.
Mantis conversion info:
- Mantis ID: 24389
- OS: Ubuntu
- OS Build: 10.04
- Build: SVN rev. 40574
- Platform: Linux
- Version: 1.0.8
- Fixed in revision: r41056 (#30324f1b)