From 6530351afcdaa3b56b7e0a948c7195568a7c2c20 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 28 Jan 2012 16:04:02 +0100 Subject: [PATCH] [Fix] Fixed middle mouse click on links. --- src/webview/webview.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/webview/webview.cpp b/src/webview/webview.cpp index 9a681bb3e..fc93d534d 100644 --- a/src/webview/webview.cpp +++ b/src/webview/webview.cpp @@ -774,6 +774,7 @@ void WebView::mousePressEvent(QMouseEvent* event) break; case Qt::MiddleButton: { + qDebug("Middle mouse press"); QWebFrame* frame = page()->frameAt(event->pos()); #ifdef Q_WS_WIN if (frame && frame->hitTestContent(event->pos()).linkUrl().isEmpty()) { @@ -785,10 +786,16 @@ void WebView::mousePressEvent(QMouseEvent* event) #endif if (frame) { m_clickedUrl = frame->hitTestContent(event->pos()).linkUrl(); + if (!m_clickedUrl.isEmpty()) { + return; + } } + + break; } case Qt::LeftButton: { + qDebug("Left mouse press"); QWebFrame* frame = page()->frameAt(event->pos()); if (frame) { QUrl link = frame->hitTestContent(event->pos()).linkUrl(); @@ -811,6 +818,7 @@ void WebView::mouseReleaseEvent(QMouseEvent* event) { switch (event->button()) { case Qt::MiddleButton: { + qDebug("Middle release"); QWebFrame* frame = page()->frameAt(event->pos()); if (frame) { QUrl link = frame->hitTestContent(event->pos()).linkUrl();