summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquickitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 7e44dfae7..ee9fa5427 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -297,7 +297,7 @@ public:
emit textureChanged();
}
- QSGTexture *texture() const Q_DECL_OVERRIDE
+ QSGTexture *texture() const override
{
if (m_sgTex)
m_sgTex->setFiltering(m_smooth ? QSGTexture::Linear : QSGTexture::Nearest);
@@ -588,6 +588,7 @@ void QWaylandQuickItem::hoverLeaveEvent(QHoverEvent *event)
}
}
+#if QT_CONFIG(wheelevent)
/*!
* \internal
*/
@@ -606,6 +607,7 @@ void QWaylandQuickItem::wheelEvent(QWheelEvent *event)
event->ignore();
}
}
+#endif
/*!
* \internal
@@ -660,6 +662,12 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
}
seat->sendFullTouchEvent(surface(), event);
+ if (event->type() == QEvent::TouchBegin) {
+ d->touchingSeats.append(seat);
+ } else if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
+ d->touchingSeats.removeOne(seat);
+ }
+
if (event->type() == QEvent::TouchBegin && d->focusOnClick)
takeFocus(seat);
} else {
@@ -667,6 +675,14 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
}
}
+void QWaylandQuickItem::touchUngrabEvent()
+{
+ Q_D(QWaylandQuickItem);
+ for (auto seat : d->touchingSeats)
+ seat->sendTouchCancelEvent(surface()->client());
+ d->touchingSeats.clear();
+}
+
#if QT_CONFIG(im)
/*!
* \internal
@@ -1266,5 +1282,10 @@ void QWaylandQuickItem::handleDragStarted(QWaylandDrag *drag)
d->isDragging = true;
}
-QT_END_NAMESPACE
+qreal QWaylandQuickItemPrivate::scaleFactor() const
+{
+ return (view->output() ? view->output()->scaleFactor() : 1)
+ / (window ? window->devicePixelRatio() : 1);
+}
+QT_END_NAMESPACE