summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandsurface.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-10-22 12:52:46 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-11-16 08:49:12 +0000
commit9c321ec34a8c52ce8ae418e962be1b5e7462ccf4 (patch)
tree68bfeeeda92678b8211ce18ac229ef6d76330db3 /src/compositor/compositor_api/qwaylandsurface.cpp
parent79b7925098936ebf3a8e6ca3119256fb4f1a52a9 (diff)
Add QWaylandSurface::bufferSize and deprecate size
Size is confusingly returning the surface size in buffer coordinates and not surface coordinates. Create a new property bufferSize and deprecated size in order to make it less ambiguous. [ChangeLog][Compositor] QWaylandSurface::size has been deprecated. Use bufferSize or destinationSize instead. Change-Id: I7985e4cc1b8d627f922680c1800d2687d710d7b3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 79b2a9d4e..59e741c84 100644
--- a/src/compositor/compositor_api/qwaylandsurface.cpp
+++ b/src/compositor/compositor_api/qwaylandsurface.cpp
@@ -270,8 +270,12 @@ void QWaylandSurfacePrivate::surface_commit(Resource *)
emit q->damaged(damage);
- if (oldBufferSize != bufferSize)
+ if (oldBufferSize != bufferSize) {
+ emit q->bufferSizeChanged();
+#if QT_DEPRECATED_SINCE(5, 13)
emit q->sizeChanged();
+#endif
+ }
if (oldBufferScale != bufferScale)
emit q->bufferScaleChanged();
@@ -457,9 +461,8 @@ bool QWaylandSurface::hasContent() const
*
* This property holds the size of this WaylandSurface in surface coordinates.
*
- * If you want the size in pixels, multiply this size with \l bufferScale.
- *
* \sa bufferScale
+ * \sa bufferSize
*/
/*!
@@ -467,9 +470,8 @@ bool QWaylandSurface::hasContent() const
*
* This property holds the size of this WaylandSurface in surface coordinates.
*
- * If you want the size in pixels, multiply this size with \l bufferScale.
- *
* \sa bufferScale
+ * \sa bufferSize
*/
QSize QWaylandSurface::destinationSize() const
{
@@ -478,28 +480,54 @@ QSize QWaylandSurface::destinationSize() const
}
/*!
- * \qmlproperty size QtWaylandCompositor::WaylandSurface::size
+ * \qmlproperty size QtWaylandCompositor::WaylandSurface::bufferSize
*
* This property holds the size of the current buffer of this WaylandSurface in pixels,
* not in surface coordinates.
*
* For the size in surface coordinates, use \l destinationSize instead.
+ *
+ * \sa destinationSize
+ * \sa bufferScale
*/
/*!
- * \property QWaylandSurface::size
+ * \property QWaylandSurface::bufferSize
*
* This property holds the size of the current buffer of this QWaylandSurface in pixels,
* not in surface coordinates.
*
* For the size in surface coordinates, use \l destinationSize instead.
+ *
+ * \sa destinationSize
+ * \sa bufferScale
*/
-QSize QWaylandSurface::size() const
+QSize QWaylandSurface::bufferSize() const
{
Q_D(const QWaylandSurface);
return d->bufferSize;
}
+#if QT_DEPRECATED_SINCE(5, 13)
+/*!
+ * \qmlproperty size QtWaylandCompositor::WaylandSurface::size
+ * \obsolete use bufferSize or destinationSize instead
+ *
+ * This property has been deprecated, use \l bufferSize or \l destinationSize instead.
+ */
+
+/*!
+ * \property QWaylandSurface::size
+ * \obsolete use bufferSize or destinationSize instead
+ *
+ * This property has been deprecated, use \l bufferSize or \l destinationSize instead.
+ */
+QSize QWaylandSurface::size() const
+{
+ return bufferSize();
+}
+#endif
+
/*!
* \qmlproperty size QtWaylandCompositor::WaylandSurface::bufferScale
*