mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
WebView: Prevent handling input events twice
This fixes site info being opened twice when pressing Ctrl+I while having focus in webview. This makes the input events handling code very fragile, so let's hope this won't break anything .. and QtWebEngine won't change the behavior in following releases.
This commit is contained in:
parent
75cb70d049
commit
7a512918f8
|
@ -29,7 +29,6 @@
|
|||
#include "adblockmanager.h"
|
||||
#include "downloadmanager.h"
|
||||
#include "mainapplication.h"
|
||||
#include "browsinglibrary.h"
|
||||
#include "clearprivatedata.h"
|
||||
#include "qzsettings.h"
|
||||
|
||||
|
|
|
@ -269,7 +269,6 @@ QString QupZillaSchemeReply::speeddialPage()
|
|||
|
||||
if (dPage.isEmpty()) {
|
||||
dPage.append(QzTools::readAllFileContents(":html/speeddial.html"));
|
||||
dPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png"));
|
||||
dPage.replace(QLatin1String("%IMG_PLUS%"), QLatin1String("qrc:html/plus.png"));
|
||||
dPage.replace(QLatin1String("%IMG_CLOSE%"), QLatin1String("qrc:html/close.png"));
|
||||
dPage.replace(QLatin1String("%IMG_EDIT%"), QLatin1String("qrc:html/edit.png"));
|
||||
|
|
|
@ -1054,9 +1054,7 @@ void WebView::_keyPressEvent(QKeyEvent *event)
|
|||
return;
|
||||
}
|
||||
|
||||
int eventKey = event->key();
|
||||
|
||||
switch (eventKey) {
|
||||
switch (event->key()) {
|
||||
case Qt::Key_ZoomIn:
|
||||
zoomIn();
|
||||
event->accept();
|
||||
|
@ -1183,5 +1181,21 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
// Block already handled events
|
||||
if (obj == this) {
|
||||
switch (event->type()) {
|
||||
case QEvent::KeyPress:
|
||||
case QEvent::KeyRelease:
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseMove:
|
||||
case QEvent::Wheel:
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return QWebEngineView::eventFilter(obj, event);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user