summaryrefslogtreecommitdiffstats
path: root/examples/wayland/qwindow-compositor
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-11 16:07:23 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:10:33 +0200
commite01b81339a37830c48f2cec0583e5d0aba592601 (patch)
treebd3085460c0139a10c5fd5d322b9059e6c97b5ee /examples/wayland/qwindow-compositor
parentbc331abe8e8ffaa3db12be7ae69e7b658dd700ac (diff)
Remove QtWayland::Surface
Its enough to have QWaylandSurface and QWaylandSurfacePrivate. Also don't pass QWaylandSurfacePrivate around, but pass QWaylandSurface and then use the QWaylandSurfacePrivate::get function. Change-Id: I915cc9d7b4497ad1c6f1f2dee61d9d0db069ba6b
Diffstat (limited to 'examples/wayland/qwindow-compositor')
-rw-r--r--examples/wayland/qwindow-compositor/qwindowcompositor.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp
index 22d097b6b..812398e1a 100644
--- a/examples/wayland/qwindow-compositor/qwindowcompositor.cpp
+++ b/examples/wayland/qwindow-compositor/qwindowcompositor.cpp
@@ -61,6 +61,7 @@
#include <QtCompositor/private/qwlshellsurface_p.h>
#include <QtCompositor/private/qwlextendedsurface_p.h>
+#include <QtCompositor/private/qwlsubsurface_p.h>
QT_BEGIN_NAMESPACE
@@ -342,7 +343,7 @@ void QWindowCompositor::render()
0, false, true);
foreach (QWaylandSurface *surface, m_surfaces) {
- if (!surface->visible())
+ if (!surface->isMapped())
continue;
drawSubSurface(QPoint(), surface);
}
@@ -362,8 +363,12 @@ void QWindowCompositor::drawSubSurface(const QPoint &offset, QWaylandSurface *su
QPoint pos = view->pos().toPoint() + offset;
QRect geo(pos, surface->size());
m_textureBlitter->drawTexture(texture, geo, m_window->size(), 0, false, invert_y);
- foreach (QWaylandSurface *child, surface->subSurfaces()) {
- drawSubSurface(pos, child);
+
+ QtWayland::SubSurface *subSurface = QtWayland::SubSurface::findIn(surface);
+ if (subSurface) {
+ foreach (QWaylandSurface *child, subSurface->subSurfaces()) {
+ drawSubSurface(pos, child);
+ }
}
}