diff --git a/src/lib/bookmarks/bookmarkstoolbar.cpp b/src/lib/bookmarks/bookmarkstoolbar.cpp index 22e063c58..984266652 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.cpp +++ b/src/lib/bookmarks/bookmarkstoolbar.cpp @@ -89,7 +89,7 @@ void BookmarksToolbar::customContextMenuRequested(const QPoint &pos) menu.addAction(tr("&Hide Toolbar"), this, SLOT(hidePanel())); //Prevent choosing first option with double rightclick - QPoint position = QCursor::pos(); + QPoint position = mapToGlobal(pos); QPoint p(position.x(), position.y() + 1); menu.exec(p); } @@ -113,7 +113,7 @@ void BookmarksToolbar::showBookmarkContextMenu(const QPoint &pos) menu.addAction(IconProvider::fromTheme("list-remove"), tr("Remove bookmark"), this, SLOT(removeButton()))->setData(buttonPointer); //Prevent choosing first option with double rightclick - QPoint position = QCursor::pos(); + QPoint position = button->mapToGlobal(pos); QPoint p(position.x(), position.y() + 1); menu.exec(p); } diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index ae1924a3c..0f5b03b29 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -312,7 +312,7 @@ void LocationBar::contextMenuEvent(QContextMenuEvent* event) m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty()); //Prevent choosing first option with double rightclick - QPoint pos = QCursor::pos(); + QPoint pos = mapToGlobal(event->pos()); QPoint p(pos.x(), pos.y() + 1); m_menu->popup(p); } diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index a4e6bcd01..eca99038c 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -276,7 +276,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event) m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty()); //Prevent choosing first option with double rightclick - QPoint pos = QCursor::pos(); + QPoint pos = mapToGlobal(event->pos()); QPoint p(pos.x(), pos.y() + 1); m_menu->popup(p); } diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index 8c555937b..5a33d2e07 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -85,7 +85,7 @@ void PopupWebView::contextMenuEvent(QContextMenuEvent* event) if (!m_menu->isEmpty()) { //Prevent choosing first option with double rightclick - const QPoint &pos = QCursor::pos(); + const QPoint &pos = mapToGlobal(event->pos()); QPoint p(pos.x(), pos.y() + 1); m_menu->popup(p); return; diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index 50a518b75..704062e3e 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -154,7 +154,7 @@ void TabBar::contextMenuRequested(const QPoint &position) } //Prevent choosing first option with double rightclick - const QPoint &pos = QCursor::pos(); + const QPoint &pos = mapToGlobal(position); QPoint p(pos.x(), pos.y() + 1); menu.exec(p); diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 7fc75311d..b1a4943d7 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -329,7 +329,7 @@ void TabbedWebView::contextMenuEvent(QContextMenuEvent* event) if (!m_menu->isEmpty()) { //Prevent choosing first option with double rightclick - const QPoint &pos = QCursor::pos(); + const QPoint &pos = mapToGlobal(event->pos()); QPoint p(pos.x(), pos.y() + 1); m_menu->popup(p);