From 874af45a1fdb77960300a896427084fc65f78aa7 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Mon, 9 Jun 2014 16:15:09 -0400 Subject: [PATCH] tmf: Bug 437000: Queue overflow dragging events table thumb in Linux Inhibit table refresh on the SWT.NONE slider selection event and perform refresh on slider mouse up instead. Change-Id: I38a6e94874f51636533cd6193ed9b2bc3e46b263 Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/28235 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle (cherry picked from commit 66e92beddc67f51046f690d9da93a819fbc89fd0) Reviewed-on: https://git.eclipse.org/r/28239 --- .../widgets/virtualtable/TmfVirtualTable.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/virtualtable/TmfVirtualTable.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/virtualtable/TmfVirtualTable.java index 0940ac13d6..7971433598 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/virtualtable/TmfVirtualTable.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/virtualtable/TmfVirtualTable.java @@ -579,7 +579,6 @@ public class TmfVirtualTable extends Composite { switch (event.detail) { case SWT.ARROW_DOWN: case SWT.ARROW_UP: - case SWT.NONE: case SWT.END: case SWT.HOME: case SWT.PAGE_DOWN: @@ -588,11 +587,27 @@ public class TmfVirtualTable extends Composite { refreshTable(); break; } + // Not handled because of bug on Linux described below. + case SWT.NONE: default: break; } } }); + + /* + * In Linux, the selection event above has event.detail set to SWT.NONE + * instead of SWT.DRAG during dragging of the thumb. To prevent refresh + * overflow, only update the table when the mouse button is released. + */ + fSlider.addMouseListener(new MouseAdapter() { + @Override + public void mouseUp(MouseEvent e) { + fTableTopEventRank = fSlider.getSelection(); + refreshTable(); + } + }); + } // ------------------------------------------------------------------------ -- 2.34.1