Make sure the GL integrations have been fully initialized in time.
authorSamuel Rødal <samuel.rodal@digia.com>
Fri, 30 Nov 2012 12:23:03 +0000 (13:23 +0100)
committerJørgen Lind <jorgen.lind@gmail.com>
Fri, 30 Nov 2012 12:42:52 +0000 (13:42 +0100)
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>
src/plugins/platforms/wayland/gl_integration/qwaylandglintegration.h
src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxintegration.h
src/plugins/platforms/wayland/qwaylanddisplay.cpp

index eaf6b01..c015ee1 100644 (file)
@@ -56,6 +56,7 @@ public:
     virtual ~QWaylandGLIntegration();
 
     virtual void initialize() = 0;
+    virtual bool waitingForEvents() { return false; }
 
     virtual bool supportsThreadedOpenGL() const { return false; }
 
index 78c8a2b..cfa9fe5 100644 (file)
@@ -67,6 +67,7 @@ public:
     ~QWaylandXCompositeEGLIntegration();
 
     void initialize();
+    bool waitingForEvents() { return !mDisplay; }
 
     QWaylandWindow *createEglWindow(QWindow *window);
     QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const;
index 5c16763..904cec8 100644 (file)
@@ -62,6 +62,7 @@ public:
     ~QWaylandXCompositeGLXIntegration();
 
     void initialize();
+    bool waitingForEvents() { return !mDisplay; }
 
     QWaylandWindow *createEglWindow(QWindow *window);
     QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const;
index 4b01f3e..44c1cd0 100644 (file)
@@ -158,6 +158,10 @@ QWaylandDisplay::QWaylandDisplay(void)
 
 #ifdef QT_WAYLAND_GL_SUPPORT
     mEglIntegration->initialize();
+
+    flushRequests();
+    while (mEglIntegration->waitingForEvents())
+        blockingReadEvents();
 #endif
 
     waitForScreens();