1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 19:12:11 +01:00

Fixed crash with "Allow js to disable context menu" option.

See f6de3bd5a0
This commit is contained in:
nowrep 2013-02-06 23:44:45 +01:00
parent f6de3bd5a0
commit 24957fd537

View File

@ -682,9 +682,14 @@ void WebView::showClickedFrameSource()
bool WebView::event(QEvent* event) bool WebView::event(QEvent* event)
{ {
if (event->type() == QEvent::ContextMenu && !qzSettings->allowJsDisableContextMenu) { if (event->type() == QEvent::ContextMenu && !qzSettings->allowJsDisableContextMenu) {
contextMenuEvent(static_cast<QContextMenuEvent*>(event)); QContextMenuEvent* ev = static_cast<QContextMenuEvent*>(event);
const QWebHitTestResult &hitTest = page()->mainFrame()->hitTestContent(ev->pos());
if (!hitTest.isContentEditable()) {
contextMenuEvent(ev);
return true; return true;
} }
}
return QWebView::event(event); return QWebView::event(event);
} }