lttng / lttng-scope

A trace viewer and analyzer for LTTng kernel and user space traces
https://lttng.org/beta/#lttng-scope
Eclipse Public License 1.0
28 stars 6 forks source link

timegraph: HScrollBar listener ignores updates when mouse leaves the view #16

Closed ghost closed 7 years ago

ghost commented 7 years ago

The horizontal scrollbar listener, which updates the view's "current position" for repaint purposes, makes use of MouseEnter/MouseExit events to determine if it should be active or not. This is used to ignore scrollbar changes caused by signals coming from other views.

This is fine for "drag start" events (if the user starts dragging the thumb, the mouse is necessarily in the view), however the mouse can technically leave the view during the drag. It's not uncommon to pull the mouse down while dragging left or right. Only the "drag start" should check for the presence of the mouse, not the the "drag end".

ghost commented 7 years ago

Turns out we don't even need the mouse enter/exit handlers anymore: the "current visible range" state is stored in only one place, so there is no ping-pong possible. Just trigger the listener every time.