diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-11-30 13:23:03 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@gmail.com> | 2012-11-30 13:42:52 +0100 |
commit | b30f9e80eddbb41a886c636f2c509c982483c4a6 (patch) | |
tree | b9ca7355299e709df768e89a233550082d5fb8ff /src/plugins/platforms/wayland | |
parent | 2246c0150c0f28a6ca9803ca2c454b2492030b8b (diff) |
Make sure the GL integrations have been fully initialized in time.
Before we return from the platform integration constructor, and thus
before the application tries to create QPlatformWindows or
QPlatformOpenGLContexts.
Change-Id: Iface9116f876e2d25561be4fcaee5fd7dabba572
Reviewed-by: Florian Hänel <florian.haenel@basyskom.com>
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Diffstat (limited to 'src/plugins/platforms/wayland')
4 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h b/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h index eaf6b01e3..c015ee1fa 100644 --- a/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h +++ b/src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h @@ -56,6 +56,7 @@ public: virtual ~QWaylandGLIntegration(); virtual void initialize() = 0; + virtual bool waitingForEvents() { return false; } virtual bool supportsThreadedOpenGL() const { return false; } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h index 78c8a2b2d..cfa9fe5cb 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h @@ -67,6 +67,7 @@ public: ~QWaylandXCompositeEGLIntegration(); void initialize(); + bool waitingForEvents() { return !mDisplay; } QWaylandWindow *createEglWindow(QWindow *window); QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const; diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h index 5c16763e7..904cec8f5 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h @@ -62,6 +62,7 @@ public: ~QWaylandXCompositeGLXIntegration(); void initialize(); + bool waitingForEvents() { return !mDisplay; } QWaylandWindow *createEglWindow(QWindow *window); QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const; diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 4b01f3e0b..44c1cd0b5 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -158,6 +158,10 @@ QWaylandDisplay::QWaylandDisplay(void) #ifdef QT_WAYLAND_GL_SUPPORT mEglIntegration->initialize(); + + flushRequests(); + while (mEglIntegration->waitingForEvents()) + blockingReadEvents(); #endif waitForScreens(); |