diff mbox series

[4/4] kernel-shark-qt: Do not auto-scrolling when the marker switches

Message ID 20190104195726.24264-4-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Headers show
Series [1/4] kernel-shark-qt: Rearrange the "Filter" top menu | expand

Commit Message

Yordan Karadzhov Jan. 4, 2019, 7:57 p.m. UTC
In some cases, the auto-scrolling (inside the table) to the
position of the marker, when the user switches between MarkerA
and MarkerB can be very annoying. This patch disables this
vertical auto-scrolling. Jumping to the position of the Active
marker is still possible, but the user has to do a second
click on the MarkerA/MarkerB button.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsTraceViewer.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/kernel-shark-qt/src/KsTraceViewer.cpp b/kernel-shark-qt/src/KsTraceViewer.cpp
index 2418de3..f02fbbb 100644
--- a/kernel-shark-qt/src/KsTraceViewer.cpp
+++ b/kernel-shark-qt/src/KsTraceViewer.cpp
@@ -578,13 +578,18 @@  void KsTraceViewer::markSwitch()
 		 */
 		size_t row =_mState->getMarker(state)._pos;
 
-		QModelIndex index = _proxyModel.mapFromSource(_model.index(row, 0));
+		QModelIndex index =
+			_proxyModel.mapFromSource(_model.index(row, 0));
 
 		/*
 		 * The row of the active marker will be colored according to
-		 * the assigned property of the current state of the Dual marker.
+		 * the assigned property of the current state of the Dual
+		 * marker. Auto-scrolling is temporarily disabled because we
+		 * do not want to scroll to the position of the marker yet.
 		 */
+		_view.setAutoScroll(false);
 		_view.selectRow(index.row());
+		_view.setAutoScroll(true);
 	} else {
 		_view.clearSelection();
 	}