Don't use QCursor::pos() for context menu position
It might now work under Wayland.
This commit is contained in:
parent
7e83f7a919
commit
6c3a230962
|
@ -453,7 +453,7 @@ void DbQueryWidget::insertSearchTermsFromActiveTagEdit()
|
|||
insertSearchTermsFromTagEdit(m_tagEditorWidget->activeTagEdit());
|
||||
}
|
||||
|
||||
void DbQueryWidget::showResultsContextMenu()
|
||||
void DbQueryWidget::showResultsContextMenu(const QPoint &pos)
|
||||
{
|
||||
const auto *const selectionModel = m_ui->resultsTreeView->selectionModel();
|
||||
if (!selectionModel) {
|
||||
|
@ -482,7 +482,7 @@ void DbQueryWidget::showResultsContextMenu()
|
|||
contextMenu.addAction(
|
||||
QIcon::fromTheme(QStringLiteral("internet-web-browser")), tr("Show in browser"), this, &DbQueryWidget::openSelectionInBrowser);
|
||||
}
|
||||
m_contextMenuPos = QCursor::pos();
|
||||
m_contextMenuPos = m_ui->resultsTreeView->viewport()->mapToGlobal(pos);
|
||||
contextMenu.exec(m_contextMenuPos);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ private slots:
|
|||
void showResults();
|
||||
void setStatus(bool aborted);
|
||||
void fileStatusChanged(bool opened, bool hasTags);
|
||||
void showResultsContextMenu();
|
||||
void showResultsContextMenu(const QPoint &pos);
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
void copySelectedResult();
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue