summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-09-11 14:13:46 +0200
committerAndy Nichols <andy.nichols@digia.com>2013-09-11 23:42:38 +0200
commit2699f123edaeb42b1fbd01b1926a3514733ef712 (patch)
tree950dd20ee1068d5be91d1a38941c3552cfd0c907
parentca3c32660ce4554f0cb0afac39f43f1168dc7bdd (diff)
downloadqtwayland-2699f123edaeb42b1fbd01b1926a3514733ef712.tar.gz
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 <andy.nichols@digia.com>
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp1
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp1
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h2
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp1
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp1
-rw-r--r--src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h2
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();