summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-05-07 15:18:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-08 18:46:56 +0200
commit1ca3a574117bdd8e67381b178a823e7d695f4bfd (patch)
treea569ed9d732a88c16739d77938c4b32954f3cb54 /src/core/render_widget_host_view_qt.cpp
parent9648528ad6fbd66eeaae3189173a7d7b47b935ce (diff)
Fix double clicks needing three presses in QWebEngineView
Since Qt 5.3 QWidget has the same behavior as Qt 4 where it will replace a second MouseButtonPress event with a MouseButtonDblClick instead of sending both. Fix the issue by moving the MouseButtonDblClick ignore code up to the QtQuick code, assume that upper layers will not send MouseButtonDblClick events, and re-replace the MouseButtonDblClick event with a MouseButtonPress in the QtWidgets code. Change-Id: I529dad2de538f486b00eb900ea6d2ed849a3b1f0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index fa3fe2312..f02729cd2 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -694,7 +694,6 @@ void RenderWidgetHostViewQt::notifyResize()
bool RenderWidgetHostViewQt::forwardEvent(QEvent *event)
{
switch (event->type()) {
- case QEvent::MouseButtonDblClick:
case QEvent::MouseButtonPress:
Focus(); // Fall through.
case QEvent::MouseButtonRelease:
@@ -869,12 +868,8 @@ bool RenderWidgetHostViewQt::IsPopup() const
void RenderWidgetHostViewQt::handleMouseEvent(QMouseEvent* event)
{
- int eventType = event->type();
- if (eventType == QEvent::MouseButtonDblClick)
- return;
-
blink::WebMouseEvent webEvent = WebEventFactory::toWebMouseEvent(event, dpiScale());
- if (eventType == QMouseEvent::MouseButtonPress) {
+ if (event->type() == QMouseEvent::MouseButtonPress) {
if (event->button() != m_clickHelper.lastPressButton
|| (event->timestamp() - m_clickHelper.lastPressTimestamp > static_cast<ulong>(qGuiApp->styleHints()->mouseDoubleClickInterval()))
|| (event->pos() - m_clickHelper.lastPressPosition).manhattanLength() > qGuiApp->styleHints()->startDragDistance())