diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-08-19 13:06:08 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2016-08-22 11:31:18 +0000 |
commit | b7075b72200b7b087e2c34fa449737970981ccea (patch) | |
tree | aeae0620bd3c64a8f836619d68ae5b4fd139dbf6 /src/compositor/compositor_api/qwaylandsurface.cpp | |
parent | 768a28b284fa806cba38f864c56ba2e2c37296f2 (diff) |
Rename QWaylandSurface::isMapped to hasContent
It was potentially misleading, since "mapped" is already used with a slightly
different meaning in the Wayland protocol. In the protocol, mapped means that
the surface should be rendered. The renamed property, on the other hand, is
true if the surface has a buffer with contents attached and committed.
In some cases this is not the same, i.e. the drag icon after dropping, or
xdg_popups after popup_done.
Change-Id: Idc359433c6130e3815de57b21d4edb13e318887d
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 98f6a1d28..09eba77e0 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -129,7 +129,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() , bufferScale(1) , isCursorSurface(false) , destroyed(false) - , mapped(false) + , hasContent(false) , isInitialized(false) , contentOrientation(Qt::PrimaryOrientation) , inputMethodControl(Q_NULLPTR) @@ -193,9 +193,9 @@ void QWaylandSurfacePrivate::notifyViewsAboutDestruction() foreach (QWaylandView *view, views) { QWaylandViewPrivate::get(view)->markSurfaceAsDestroyed(q); } - if (mapped) { - mapped = false; - emit q->mappedChanged(); + if (hasContent) { + hasContent = false; + emit q->hasContentChanged(); } } @@ -342,10 +342,10 @@ void QWaylandSurfacePrivate::setBackBuffer(QtWayland::SurfaceBuffer *b, const QR emit q->damaged(damage); - bool oldMapped = mapped; - mapped = QtWayland::SurfaceBuffer::hasContent(buffer); - if (oldMapped != mapped) - emit q->mappedChanged(); + bool oldHasContent = hasContent; + hasContent = QtWayland::SurfaceBuffer::hasContent(buffer); + if (oldHasContent != hasContent) + emit q->hasContentChanged(); if (!pending.offset.isNull()) emit q->offsetForNextFrame(pending.offset); @@ -484,20 +484,20 @@ QWaylandClient *QWaylandSurface::client() const } /*! - * \qmlproperty bool QtWaylandCompositor::WaylandSurface::isMapped + * \qmlproperty bool QtWaylandCompositor::WaylandSurface::hasContent * * This property holds whether the WaylandSurface has content. */ /*! - * \property QWaylandSurface::isMapped + * \property QWaylandSurface::hasContent * * This property holds whether the QWaylandSurface has content. */ -bool QWaylandSurface::isMapped() const +bool QWaylandSurface::hasContent() const { Q_D(const QWaylandSurface); - return d->mapped; + return d->hasContent; } /*! |