From 24957fd537f5f3019ed67e3d5de1c9ad194cd449 Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 6 Feb 2013 23:44:45 +0100 Subject: [PATCH] Fixed crash with "Allow js to disable context menu" option. See f6de3bd5a01b6f9468b0dcf32744a879e811c255 --- src/lib/webview/webview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/webview/webview.cpp b/src/lib/webview/webview.cpp index c0508485a..b375b887e 100644 --- a/src/lib/webview/webview.cpp +++ b/src/lib/webview/webview.cpp @@ -682,8 +682,13 @@ void WebView::showClickedFrameSource() bool WebView::event(QEvent* event) { if (event->type() == QEvent::ContextMenu && !qzSettings->allowJsDisableContextMenu) { - contextMenuEvent(static_cast(event)); - return true; + QContextMenuEvent* ev = static_cast(event); + const QWebHitTestResult &hitTest = page()->mainFrame()->hitTestContent(ev->pos()); + + if (!hitTest.isContentEditable()) { + contextMenuEvent(ev); + return true; + } } return QWebView::event(event);