diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 400c029f2..4ec399fec 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -279,12 +279,15 @@ void FriendsDialog::pasteLink() void FriendsDialog::contextMenuMsgText(QPoint point) { - QMenu *contextMnu = ui.msgText->createStandardContextMenu(point); + QMatrix matrix; + matrix.translate(ui.msgText->horizontalScrollBar()->value(), ui.msgText->verticalScrollBar()->value()); + + QMenu *contextMnu = ui.msgText->createStandardContextMenu(matrix.map(point)); contextMnu->addSeparator(); contextMnu->addAction(ui.actionClear_Chat_History); - contextMnu->exec(QCursor::pos()); + contextMnu->exec(ui.msgText->viewport()->mapToGlobal(point)); delete(contextMnu); } diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 24209d2ff..4fd288ce7 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -415,12 +415,15 @@ void ChatWidget::contextMenu(QPoint point) void ChatWidget::contextMenuTextBrowser(QPoint point) { - QMenu *contextMnu = ui->textBrowser->createStandardContextMenu(point); + QMatrix matrix; + matrix.translate(ui->textBrowser->horizontalScrollBar()->value(), ui->textBrowser->verticalScrollBar()->value()); + + QMenu *contextMnu = ui->textBrowser->createStandardContextMenu(matrix.map(point)); contextMnu->addSeparator(); contextMnu->addAction(ui->actionClearChatHistory); - contextMnu->exec(QCursor::pos()); + contextMnu->exec(ui->textBrowser->viewport()->mapToGlobal(point)); delete(contextMnu); }