summaryrefslogtreecommitdiffstats
path: root/examples/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland')
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index 8ba8929e1..e224cd1c3 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -72,8 +72,11 @@ View::View(Compositor *compositor)
QOpenGLTexture *View::getTexture()
{
- if (advance()) {
- QWaylandBufferRef buf = currentBuffer();
+ bool newContent = advance();
+ QWaylandBufferRef buf = currentBuffer();
+ if (!buf.hasContent())
+ m_texture = nullptr;
+ if (newContent) {
m_texture = buf.toOpenGLTexture();
if (surface()) {
m_size = surface()->size();