summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorKaloyan Chehlarski <kaloyan.chehlarski@qt.io>2024-02-21 17:00:22 +0100
committerKaloyan Chehlarski <kaloyan.chehlarski@qt.io>2024-04-11 08:28:25 +0000
commitbc4b936c75cda75ba2749e31f2a19c03e7d5cce2 (patch)
tree7db270101b3735891e8c66918674cb9a5ae9f871 /src/core
parentb816bf293dcc3acf39de8df58f2875cc9a361f80 (diff)
Fix Quick WebEngine middle mouse button scrolling
In Qt Quick, mouse movement will be sent to WebEngine as a QHoverEvent instead of a QMouseEvent. This change makes sure that when converting a QHoverEvent to a WebMouseEvent, the screen position is set correctly. This, in turn, ensures that Chromium will correctly interpret mouse movement when performing a middle mouse button scroll; instead of immediately jumping to the top left of the page, it will now scroll correctly. Fixes: QTBUG-120131 Change-Id: Ic5cac761974d422bf1f774616e99e5edbf82f4de Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/web_event_factory.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
index c2b5d5c53..617eea2d0 100644
--- a/src/core/web_event_factory.cpp
+++ b/src/core/web_event_factory.cpp
@@ -1445,6 +1445,7 @@ WebMouseEvent WebEventFactory::toWebMouseEvent(QHoverEvent *ev)
webKitEvent.SetType(webEventTypeForEvent(ev));
webKitEvent.SetPositionInWidget(ev->position().x(), ev->position().y());
+ webKitEvent.SetPositionInScreen(ev->globalPosition().x(), ev->globalPosition().y());
webKitEvent.movement_x = ev->position().x() - ev->oldPos().x();
webKitEvent.movement_y = ev->position().y() - ev->oldPos().y();
webKitEvent.is_raw_movement_event = true;