summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-29 12:42:11 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-11-02 05:13:29 +0000
commit8eda96bc8ae68387807e079cd557c98c4a452c4f (patch)
tree6332835297b743158ea6d6dbe4908bd26ba0d9e0
parent41f8b4883afddf2868beacedaf8270553237ceaf (diff)
Fix smooth-scrolling of mouse wheelsv5.12.0-beta4
Turns out has_precise_scrolling_deltas, doesn't mean what its name says, but instead is a macOS'ism indicating a system scroll gesture. Fixes: QTBUG-71378 Change-Id: I124ba8f64495671e8a8ad7a9c397fb506d7fedf9 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r--src/core/web_event_factory.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index 04d4930e..5e784a4e 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1449,7 +1449,11 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub
webEvent.wheel_ticks_x = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep;
webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep;
webEvent.phase = toBlinkPhase(ev);
- webEvent.has_precise_scrolling_deltas = true;
+#if defined(Q_OS_DARWIN)
+ // has_precise_scrolling_deltas is a macOS term meaning it is a system scroll gesture, see qnsview_mouse.mm
+ webEvent.has_precise_scrolling_deltas = (ev->source() == Qt::MouseEventSynthesizedBySystem);
+#endif
+
setBlinkWheelEventDelta(webEvent);
return webEvent;
@@ -1463,6 +1467,10 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent,
return false;
if (toBlinkPhase(ev) != webEvent.phase)
return false;
+#if defined(Q_OS_DARWIN)
+ if (webEvent.has_precise_scrolling_deltas != (ev->source() == Qt::MouseEventSynthesizedBySystem))
+ return false;
+#endif
webEvent.SetTimeStamp(currentTimeForEvent(ev));
webEvent.SetPositionInWidget(ev->x() / dpiScale, ev->y() / dpiScale);