summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-08-19 13:06:08 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2016-08-22 11:31:18 +0000
commitb7075b72200b7b087e2c34fa449737970981ccea (patch)
treeaeae0620bd3c64a8f836619d68ae5b4fd139dbf6 /examples
parent768a28b284fa806cba38f864c56ba2e2c37296f2 (diff)
downloadqtwayland-b7075b72200b7b087e2c34fa449737970981ccea.tar.gz
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 'examples')
-rw-r--r--examples/wayland/minimal-cpp/window.cpp2
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp8
-rw-r--r--examples/wayland/qwindow-compositor/compositor.h2
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp2
-rw-r--r--examples/wayland/server-buffer/compositor/main.cpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp
index 25ea6b64..2d529cce 100644
--- a/examples/wayland/minimal-cpp/window.cpp
+++ b/examples/wayland/minimal-cpp/window.cpp
@@ -85,7 +85,7 @@ void Window::paintGL()
continue;
GLuint textureId = view->getTexture();
QWaylandSurface *surface = view->surface();
- if (surface && surface->isMapped()) {
+ if (surface && surface->hasContent()) {
QSize s = surface->size();
QPointF pos(sillyrandom(width() - s.width()), sillyrandom(height() - s.height()));
QRectF surfaceGeometry(pos, s);
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index b7cdbbd9..13e5718d 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -171,7 +171,7 @@ void Compositor::create()
void Compositor::onSurfaceCreated(QWaylandSurface *surface)
{
connect(surface, &QWaylandSurface::surfaceDestroyed, this, &Compositor::surfaceDestroyed);
- connect(surface, &QWaylandSurface::mappedChanged, this, &Compositor::surfaceMappedChanged);
+ connect(surface, &QWaylandSurface::hasContentChanged, this, &Compositor::surfaceHasContentChanged);
connect(surface, &QWaylandSurface::redraw, this, &Compositor::triggerRender);
connect(surface, &QWaylandSurface::subsurfacePositionChanged, this, &Compositor::onSubsurfacePositionChanged);
@@ -184,10 +184,10 @@ void Compositor::onSurfaceCreated(QWaylandSurface *surface)
connect(surface, &QWaylandSurface::offsetForNextFrame, view, &View::onOffsetForNextFrame);
}
-void Compositor::surfaceMappedChanged()
+void Compositor::surfaceHasContentChanged()
{
QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender());
- if (surface->isMapped()) {
+ if (surface->hasContent()) {
if (surface->role() == QWaylandWlShellSurface::role()
|| surface->role() == QWaylandXdgSurface::role()
|| surface->role() == QWaylandXdgPopup::role()) {
@@ -374,7 +374,7 @@ void Compositor::adjustCursorSurface(QWaylandSurface *surface, int hotspotX, int
m_cursorHotspotX = hotspotX;
m_cursorHotspotY = hotspotY;
- if (surface && surface->isMapped())
+ if (surface && surface->hasContent())
updateCursor();
}
diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h
index 243e5dbe..3de25a9b 100644
--- a/examples/wayland/qwindow-compositor/compositor.h
+++ b/examples/wayland/qwindow-compositor/compositor.h
@@ -119,7 +119,7 @@ signals:
void frameOffset(const QPoint &offset);
private slots:
- void surfaceMappedChanged();
+ void surfaceHasContentChanged();
void surfaceDestroyed();
void viewSurfaceDestroyed();
void onStartMove();
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index 86a1f865..b73c7be3 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -129,7 +129,7 @@ void Window::paintGL()
m_textureBlitter.bind(currentTarget);
}
QWaylandSurface *surface = view->surface();
- if (surface && surface->isMapped()) {
+ if (surface && surface->hasContent()) {
QSize s = surface->size();
if (!s.isEmpty()) {
if (m_mouseView == view && m_grabState == ResizeGrab && m_resizeAnchored)
diff --git a/examples/wayland/server-buffer/compositor/main.cpp b/examples/wayland/server-buffer/compositor/main.cpp
index 57ca647b..9c5ee42a 100644
--- a/examples/wayland/server-buffer/compositor/main.cpp
+++ b/examples/wayland/server-buffer/compositor/main.cpp
@@ -219,7 +219,7 @@ protected:
void onSurfaceCreated(QWaylandSurface *surface) {
QWaylandQuickItem *item = new QWaylandQuickItem();
item->setSurface(surface);
- connect(surface, &QWaylandSurface::mappedChanged, this, &QmlCompositor::surfaceMapped);
+ connect(surface, &QWaylandSurface::hasContentChanged, this, &QmlCompositor::surfaceMapped);
}
void share_buffer_bind_resource(Resource *resource) Q_DECL_OVERRIDE