From 2699f123edaeb42b1fbd01b1926a3514733ef712 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 11 Sep 2013 14:13:46 +0200 Subject: Wayland platform: Fix xcomposite backends not to hang after the first GL frame attach() needs to be called from swapBuffers(), not just once from createSurface(). Change-Id: I8545c1a16179d9e78ae45c0532c89a6298820aa4 Reviewed-by: Andy Nichols --- .../platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp | 1 + .../platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp | 1 - .../platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h | 2 ++ .../platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp | 1 + .../platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp | 1 - .../platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h | 2 ++ 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp index 8d4a99b9..1ebcdde1 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp @@ -64,6 +64,7 @@ void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface) QSize size = w->geometry().size(); + w->attach(w->buffer(), 0, 0); w->damage(QRect(QPoint(), size)); w->commit(); w->waitForFrameSync(); diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp index f0df2bd2..4b414451 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp @@ -131,7 +131,6 @@ void QWaylandXCompositeEGLWindow::createEglSurface() m_buffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(), (uint32_t)m_xWindow, size); - attach(m_buffer, 0, 0); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h index 8fb63118..a9642c58 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h @@ -60,6 +60,8 @@ public: EGLSurface eglSurface() const; + QWaylandBuffer *buffer() { return m_buffer; } + private: void createEglSurface(); diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp index d3101945..4ee02260 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp @@ -90,6 +90,7 @@ void QWaylandXCompositeGLXContext::swapBuffers(QPlatformSurface *surface) glXSwapBuffers(m_display, w->xWindow()); + w->attach(w->buffer(), 0, 0); w->damage(QRect(QPoint(), size)); w->commit(); w->waitForFrameSync(); diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp index 3a64961f..f33790f3 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp @@ -118,7 +118,6 @@ void QWaylandXCompositeGLXWindow::createSurface() m_buffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(), (uint32_t)m_xWindow, size); - attach(m_buffer, 0, 0); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h index b436cbbe..88f417f2 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h @@ -62,6 +62,8 @@ public: Window xWindow() const; + QWaylandBuffer *buffer() { return m_buffer; } + private: void createSurface(); -- cgit v1.2.1