tmf: Fix unresponsive UI when mouse wheel zooming in TimeGraphViewer
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 15 Dec 2016 15:30:15 +0000 (10:30 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 19 Dec 2016 20:24:56 +0000 (15:24 -0500)
commit4c976c37192a7bdeb4ea71ba01ad67a76269780d
tree4a7afd9e1dd058bb7c34927e311e413ab3bbf222
parentb281a79b72d1da13e4b6028fea1b34f763b8b3ed
tmf: Fix unresponsive UI when mouse wheel zooming in TimeGraphViewer

When developing the time graph marker axis, it was noticed under Windows
that there was a delay in painting the marker axis when compared to the
time graph state area. It seems that if a new redraw request occurs
while the time graph state area is being painted, the following control
in the draw order (the marker axis) is not painted before until the next
paint event. The visual effect is that the time graph state area follows
the user input while the marker axis does not update until the user
input stops.

The solution found was to call Control.update() on those parts, which
would block the UI thread until all parts have been painted.

However, under Linux this can cause pending user inputs to be queued.
While the time graph is painting, rapid mouse wheel scrolling queues
many MouseEvent that each individually trigger blocking paint events.
This also prevents many mouse wheel scroll events to eventually combine
into triggering a single paint event. After quickly scrolling the mouse
wheel many times then stopping, the user can see the queued events
triggering a multitude of paint events that can last a few seconds even
while there is no user input. Any new user input needs to wait for all
the queued paint events to be completed before being processed.

The blocking calls to update() are therefore removed. This can cause a
temporary visual misalignment under Windows, but this effect is much
less noticeable under Linux.

Change-Id: I12d3d17eff0d8a443822083e0aa2113c3b23fedc
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/87246
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphViewer.java
This page took 0.024303 seconds and 5 git commands to generate.