diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-09-14 16:24:30 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-09-16 10:35:14 +0000 |
commit | dae5d55dea859bb3a5722bf665d077f1f9b3d360 (patch) | |
tree | d08e0906b015add456105a1bc261fdcfba2f8701 /src/compositor/compositor_api | |
parent | e9aa3a9edf63ff0f47f38e73ef20403f7bec1a0d (diff) |
Implement resize/move for pure-qml
Change-Id: I7919f7715486fa2d8cfe35c08095f6c33757a515
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/compositor/compositor_api')
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 10 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.h | 3 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.h | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index f108e0f67..90ca49d53 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -177,10 +177,10 @@ QSGTextureProvider *QWaylandQuickItem::textureProvider() const return d->provider; } + void QWaylandQuickItem::mousePressEvent(QMouseEvent *event) { Q_D(QWaylandQuickItem); - m_mousePressPosition = event->windowPos(); if (!d->shouldSendInputEvents()) { event->ignore(); return; @@ -214,7 +214,6 @@ void QWaylandQuickItem::mouseMoveEvent(QMouseEvent *event) void QWaylandQuickItem::mouseReleaseEvent(QMouseEvent *event) { Q_D(QWaylandQuickItem); - m_mousePressPosition = QPointF(); if (d->shouldSendInputEvents()) { QWaylandInputDevice *inputDevice = compositor()->inputDeviceFor(event); inputDevice->sendMouseReleaseEvent(event->button()); @@ -345,6 +344,12 @@ void QWaylandQuickItem::mouseUngrabEvent() } } +void QWaylandQuickItem::surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface) +{ + Q_UNUSED(newSurface); + Q_UNUSED(oldSurface); +} + void QWaylandQuickItem::handleSurfaceChanged() { Q_D(QWaylandQuickItem); @@ -372,6 +377,7 @@ void QWaylandQuickItem::handleSurfaceChanged() d->view->setOutput(output); } } + surfaceChangedEvent(d->view->surface(), d->oldSurface); d->oldSurface = d->view->surface(); } diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 709e3e9c6..5bdd30566 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -67,7 +67,6 @@ class Q_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem Q_PROPERTY(bool resizeSurfaceToItem READ resizeSurfaceToItem WRITE setResizeSurfaceToItem NOTIFY resizeSurfaceToItemChanged) Q_PROPERTY(bool inputEventsEnabled READ inputEventsEnabled WRITE setInputEventsEnabled NOTIFY inputEventsEnabledChanged) Q_PROPERTY(bool focusOnClick READ focusOnClick WRITE setFocusOnClick NOTIFY focusOnClickChanged) - Q_PROPERTY(QPointF mousePressPosition READ mousePressPosition) public: QWaylandQuickItem(QQuickItem *parent = 0); @@ -113,6 +112,7 @@ protected: void touchEvent(QTouchEvent *event); void mouseUngrabEvent() Q_DECL_OVERRIDE; + virtual void surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface); public Q_SLOTS: virtual void takeFocus(QWaylandInputDevice *device = 0); void setPaintEnabled(bool paintEnabled); @@ -141,7 +141,6 @@ protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); QWaylandQuickItem(QWaylandQuickItemPrivate &dd, QQuickItem *parent = 0); - QPointF m_mousePressPosition; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index 12209673f..5917e8c01 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -69,6 +69,7 @@ class Q_COMPOSITOR_EXPORT QWaylandSurface : public QObject, public QWaylandExten Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged) Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged) Q_PROPERTY(bool isMapped READ isMapped NOTIFY mappedChanged) + Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface) public: enum Origin { |