linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu
@ 2018-11-30 15:38 Yordan Karadzhov
  2018-11-30 15:38 ` [PATCH 2/2] kernel-shark-qt: Add better handling of the search iterator Yordan Karadzhov
  2018-11-30 15:58 ` [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Yordan Karadzhov @ 2018-11-30 15:38 UTC (permalink / raw)
  To: rostedt@goodmis.org; +Cc: linux-trace-devel@vger.kernel.org

The "Y" coordinate of the Quick Context Menu has to be corrected in
the case when the menu gets opened from the Graph widget. This is
needed because the Graph widget is nested inside a scroll area and
we have to take into account the offset of the vertical scrollbar.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsTraceGraph.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel-shark-qt/src/KsTraceGraph.cpp b/kernel-shark-qt/src/KsTraceGraph.cpp
index 0b5a8b1..858930c 100644
--- a/kernel-shark-qt/src/KsTraceGraph.cpp
+++ b/kernel-shark-qt/src/KsTraceGraph.cpp
@@ -782,6 +782,12 @@ void KsTraceGraph::_onCustomContextMenu(const QPoint &point)
 		connect(menu,	&KsQuickMarkerMenu::deselect,
 			this,	&KsTraceGraph::deselect);
 
-		menu->exec(mapToGlobal(point));
+		QPoint global = mapToGlobal(point);
+		/*
+		 * The global coordinates have to be corrected for the offset
+		 * of the vertical scrollbar.
+		 */
+		global.ry() -= _scrollArea.verticalScrollBar()->value();
+		menu->exec(global);
 	}
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-01  3:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-30 15:38 [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu Yordan Karadzhov
2018-11-30 15:38 ` [PATCH 2/2] kernel-shark-qt: Add better handling of the search iterator Yordan Karadzhov
2018-11-30 15:58 ` [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).