diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-09-08 08:45:24 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-09-16 14:47:45 +0200 |
commit | a54988c822de918933af62c3d39212f223bfb2c4 (patch) | |
tree | b41520b4d874ff98dd63675f53f0877091b4d899 /src | |
parent | 1fdbbb49d9f2d2bb62e151a29e5615031af6606a (diff) |
Mouse->touch synthesis: send touch event with mouse device
In 4e400369c08db251cd489fec1229398c224d02b4 we began to send synth-mouse
events from the touch device, but in the opposite direction it was not
consistent.
Add autotests to prove that it's consistent both ways now.
Change-Id: I7df2328fef224dc1529ca5d27411cd8a5a9c8df9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2bbeef4c30..ffb9b26ee7 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -189,7 +189,6 @@ static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto; static bool force_reverse = false; QGuiApplicationPrivate *QGuiApplicationPrivate::self = nullptr; -QPointingDevice *QGuiApplicationPrivate::m_fakeTouchDevice = nullptr; int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0; #ifndef QT_NO_CLIPBOARD @@ -2282,10 +2281,6 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (!e->synthetic() && !ev.isAccepted() && !e->nonClientArea && qApp->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)) { - if (!m_fakeTouchDevice) { - m_fakeTouchDevice = new QPointingDevice; - QWindowSystemInterface::registerInputDevice(m_fakeTouchDevice); - } QList<QWindowSystemInterface::TouchPoint> points; QWindowSystemInterface::TouchPoint point; point.id = 1; @@ -2310,7 +2305,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo const QList<QEventPoint> &touchPoints = QWindowSystemInterfacePrivate::fromNativeTouchPoints(points, window, &type); - QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, m_fakeTouchDevice, touchPoints, e->modifiers); + QWindowSystemInterfacePrivate::TouchEvent fake(window, e->timestamp, type, device, touchPoints, e->modifiers); fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic; processTouchEvent(&fake); } |