diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-08-01 09:43:59 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-08-02 07:11:26 +0000 |
commit | da364484aa51ce7c73d39ce0ca444169ce69588e (patch) | |
tree | f0f7a16975b43dec9f521e1d5ebaee8139ca9c0a /tests/auto/client/mockcompositor.cpp | |
parent | 798127e5c9a107ddd8cc1c04495ce39b64513bdb (diff) |
Fix crash when dragging with touch without first having pointer focus
Also add drag-and-drop tests for both touch and mouse.
Task-number: QTBUG-54756
Change-Id: Ibfff48b1f2377022a8624e28e9f638076187ddca
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/mockcompositor.cpp')
-rw-r--r-- | tests/auto/client/mockcompositor.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/client/mockcompositor.cpp b/tests/auto/client/mockcompositor.cpp index 7eb683191..83dd52ba2 100644 --- a/tests/auto/client/mockcompositor.cpp +++ b/tests/auto/client/mockcompositor.cpp @@ -150,6 +150,47 @@ void MockCompositor::sendTouchFrame(const QSharedPointer<MockSurface> &surface) processCommand(command); } +void MockCompositor::sendDataDeviceDataOffer(const QSharedPointer<MockSurface> &surface) +{ + Command command = makeCommand(Impl::Compositor::sendDataDeviceDataOffer, m_compositor); + command.parameters << QVariant::fromValue(surface); + processCommand(command); +} + +void MockCompositor::sendDataDeviceEnter(const QSharedPointer<MockSurface> &surface, const QPoint& position) +{ + Command command = makeCommand(Impl::Compositor::sendDataDeviceEnter, m_compositor); + command.parameters << QVariant::fromValue(surface) << QVariant::fromValue(position); + processCommand(command); +} + +void MockCompositor::sendDataDeviceMotion(const QPoint &position) +{ + Command command = makeCommand(Impl::Compositor::sendDataDeviceMotion, m_compositor); + command.parameters << QVariant::fromValue(position); + processCommand(command); +} + +void MockCompositor::sendDataDeviceDrop(const QSharedPointer<MockSurface> &surface) +{ + Command command = makeCommand(Impl::Compositor::sendDataDeviceDrop, m_compositor); + command.parameters << QVariant::fromValue(surface); + processCommand(command); +} + +void MockCompositor::sendDataDeviceLeave(const QSharedPointer<MockSurface> &surface) +{ + Command command = makeCommand(Impl::Compositor::sendDataDeviceLeave, m_compositor); + command.parameters << QVariant::fromValue(surface); + processCommand(command); +} + +void MockCompositor::waitForStartDrag() +{ + Command command = makeCommand(Impl::Compositor::waitForStartDrag, m_compositor); + processCommand(command); +} + QSharedPointer<MockSurface> MockCompositor::surface() { QSharedPointer<MockSurface> result; @@ -228,6 +269,7 @@ namespace Impl { Compositor::Compositor() : m_display(wl_display_create()) + , m_startDragSeen(false) , m_time(0) { wl_list_init(&m_outputResources); |