@@ -791,6 +791,13 @@ void KsTraceGraph::_onCustomContextMenu(const QPoint &point)
QPoint global = _glWindow.mapToGlobal(point);
global.ry() -= menu->sizeHint().height() / 2;
+ /*
+ * Shift the menu so that it is not positioned under the mouse.
+ * This will prevent from an accidental selection of the menu
+ * item under the mouse.
+ */
+ global.rx() += FONT_WIDTH;
+
menu->exec(global);
}
}
@@ -272,6 +272,13 @@ void KsTraceViewer::_onCustomContextMenu(const QPoint &point)
QPoint global = _view.mapToGlobal(point);
global.ry() -= menu.sizeHint().height() / 2;
+ /*
+ * Shift the menu so that it is not positioned under the mouse.
+ * This will prevent from an accidental selection of the menu
+ * item under the mouse.
+ */
+ global.rx() += FONT_WIDTH;
+
connect(&menu, &KsQuickContextMenu::addTaskPlot,
this, &KsTraceViewer::addTaskPlot);
The menu is shifted just a bit so that it is not positioned under the mouse. This will prevent from an accidental selection of the menu item under the mouse. Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com> --- kernel-shark-qt/src/KsTraceGraph.cpp | 7 +++++++ kernel-shark-qt/src/KsTraceViewer.cpp | 7 +++++++ 2 files changed, 14 insertions(+)