summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
86cb4cb)
Change-Id: I03318359d13caf7287671bcc9e01da91acb928dd
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
setSmooth(true);
setFlag(ItemHasContents);
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
setSmooth(true);
setFlag(ItemHasContents);
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
+ setAcceptHoverEvents(true);
connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped()));
connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped()));
connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
if (m_touchEventsEnabled && m_surface) {
WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice();
event->accept();
if (m_touchEventsEnabled && m_surface) {
WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice();
event->accept();
- QList<QTouchEvent::TouchPoint> points = event->touchPoints();
- if (!points.isEmpty()) {
- for (int i = 0; i < points.count(); ++i) {
- const QTouchEvent::TouchPoint &point(points.at(i));
- // Wayland expects surface-relative coordinates.
- inputDevice->sendTouchPointEvent(point.id(), point.pos().x(), point.pos().y(), point.state());
- }
- inputDevice->sendTouchFrameEvent();
+ if (inputDevice->mouseFocus() != m_surface) {
+ QPoint pointPos;
+ QList<QTouchEvent::TouchPoint> points = event->touchPoints();
+ if (!points.isEmpty())
+ pointPos = points.at(0).pos().toPoint();
+ inputDevice->setMouseFocus(m_surface, pointPos, pointPos);
+ inputDevice->sendFullTouchEvent(event);
} else {
event->ignore();
}
} else {
event->ignore();
}