summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-07-25 14:00:58 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-08-29 11:23:03 +0000
commit67f49277e68693dde6fd9ad0dd5b58885c33599c (patch)
treec53b8436a5d91c91b63b40db93fbedb9a1942934
parentf559f0400ebd105ef048195e477248ff1f39f6e8 (diff)
[macOS] Warn about sending simulated touch events not working on macOS
Chromium itself does not really support processing touch events on macOS, but rather uses native gestures sent by the OS. Warn the user in case they send simulated QTouchEvents. Task-number: QTBUG-62130 Change-Id: If47f25bc06f3d6f99ba70164a585182354ed9b5a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/render_widget_host_view_qt.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 958ff91e1..728357e14 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -80,6 +80,7 @@
#include <QFocusEvent>
#include <QGuiApplication>
#include <QInputMethodEvent>
+#include <QLoggingCategory>
#include <QTextFormat>
#include <QKeyEvent>
#include <QMouseEvent>
@@ -1346,11 +1347,20 @@ void RenderWidgetHostViewQt::handleGestureEvent(QNativeGestureEvent *ev)
}
}
+Q_DECLARE_LOGGING_CATEGORY(QWEBENGINE_TOUCH_HANDLING);
+Q_LOGGING_CATEGORY(QWEBENGINE_TOUCH_HANDLING, "qt.webengine.touch");
+
void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev)
{
// On macOS instead of handling touch events, we use the OS provided QNativeGestureEvents.
#ifdef Q_OS_MACOS
- return;
+ if (ev->spontaneous()) {
+ return;
+ } else {
+ qCWarning(QWEBENGINE_TOUCH_HANDLING)
+ << "Sending simulated touch events to Chromium does not work properly on macOS. "
+ "Consider using QNativeGestureEvents or QMouseEvents.";
+ }
#endif
// Chromium expects the touch event timestamps to be comparable to base::TimeTicks::Now().