diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-08-28 12:39:54 +0300 |
---|---|---|
committer | Andrew Knight <andrew.knight@digia.com> | 2013-08-28 11:51:48 +0200 |
commit | c4e89d992e746f8957ef6934f6ee51f620e07cf7 (patch) | |
tree | cc000dbe5737ac36a3d76f1db5d3019180a517b2 /src | |
parent | 46506fa33789c1504ea3c2d7750c771f1547d5f3 (diff) |
Remove QWaylandSurface::setSize because it is not meaningful
Setting the surface size from the compositor is not meaningful; there
should be a roundtrip from the client before the size of the surface
is considered changed. This makes size a read-only property and makes
the requestSize (formerly sendConfigure) method invokable so that it can
be used from e.g. QML. The name change to requestSize follows the
convention that the size property will likely, but not necessarily,
change when a client-dependent property is set.
Change-Id: I4d2cfdb938a92f9d80b4fd1a443f0a659f73c690
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 8 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.h | 5 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurfaceitem.cpp | 2 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index a51e1901f..88b68ebd1 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -149,13 +149,7 @@ QSize QWaylandSurface::size() const return d->surface->size(); } -void QWaylandSurface::setSize(const QSize &size) -{ - Q_D(QWaylandSurface); - d->surface->setSize(size); -} - -void QWaylandSurface::sendConfigure(const QSize &size) +void QWaylandSurface::requestSize(const QSize &size) { Q_D(QWaylandSurface); if (d->surface->shellSurface()) diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index b4f786b88..308e8d546 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -73,7 +73,7 @@ class Q_COMPOSITOR_EXPORT QWaylandSurface : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandSurface) - Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged) + Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged) Q_PROPERTY(QWaylandSurface::WindowFlags windowFlags READ windowFlags NOTIFY windowFlagsChanged) Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged) @@ -113,8 +113,7 @@ public: QPointF pos() const; void setPos(const QPointF &pos); QSize size() const; - void setSize(const QSize &size); - void sendConfigure(const QSize &size); + Q_INVOKABLE void requestSize(const QSize &size); Qt::ScreenOrientations orientationUpdateMask() const; Qt::ScreenOrientation contentOrientation() const; diff --git a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp index 980cd37f5..dde6848b1 100644 --- a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp @@ -333,7 +333,7 @@ void QWaylandSurfaceItem::updateSize() void QWaylandSurfaceItem::updateSurfaceSize() { if (m_resizeSurfaceToItem) { - m_surface->sendConfigure(QSize(width(), height())); + m_surface->requestSize(QSize(width(), height())); } } |