summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-15 11:57:44 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-17 10:59:10 +0200
commit060c09b23b9ec0376fa7fd687d1f853660410f2a (patch)
tree89215d8a6dc969de1329c94c025f3f460ac08c78 /src
parent9a90cd56c432f2ad3e811449cb199b11c6ed9de8 (diff)
Disable navigation on back/forward mouse buttons in Qt 5
Submodule src/3rdparty 809e16e4..840c8e5f: > Make navigation on back/forward mouse buttons optional Change-Id: I191f7781cf9b824b743b80a05a3e819a414ee546 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/core/web_contents_delegate_qt.cpp9
-rw-r--r--src/core/web_contents_delegate_qt.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 809e16e4ac75c0d7eb39cef6a2d29544971b8d3
+Subproject 840c8e5faabf27e8874cd1152454c113597bb3e
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 54ae4937a..f13621b99 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -807,6 +807,15 @@ void WebContentsDelegateQt::ContentsZoomChange(bool zoom_in)
adapter->setZoomFactor(adapter->currentZoomFactor() - 0.1f);
}
+bool WebContentsDelegateQt::ShouldNavigateOnBackForwardMouseButtons()
+{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ return false;
+#else
+ return true;
+#endif
+}
+
FaviconManager *WebContentsDelegateQt::faviconManager()
{
return m_faviconManager.data();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index bfef9a1df..8a9d8be1b 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -168,6 +168,7 @@ public:
void OnVisibilityChanged(content::Visibility visibility) override;
void DidFirstVisuallyNonEmptyPaint() override;
void ActivateContents(content::WebContents* contents) override;
+ bool ShouldNavigateOnBackForwardMouseButtons() override;
void didFailLoad(const QUrl &url, int errorCode, const QString &errorDescription);
void overrideWebPreferences(content::WebContents *, content::WebPreferences*);