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

[Fix] Fixed middle mouse click on links.

This commit is contained in:
nowrep 2012-01-28 16:04:02 +01:00
parent a044302a92
commit 6530351afc

View File

@ -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();