Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Rødal authored and jorgen committed Nov 30, 2012
1 parent 2246c01 commit b30f9e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Expand Up @@ -56,6 +56,7 @@ class QWaylandGLIntegration
virtual ~QWaylandGLIntegration();

virtual void initialize() = 0;
virtual bool waitingForEvents() { return false; }

virtual bool supportsThreadedOpenGL() const { return false; }

Expand Down
Expand Up @@ -67,6 +67,7 @@ class QWaylandXCompositeEGLIntegration : public QWaylandGLIntegration
~QWaylandXCompositeEGLIntegration();

void initialize();
bool waitingForEvents() { return !mDisplay; }

QWaylandWindow *createEglWindow(QWindow *window);
QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const;
Expand Down
Expand Up @@ -62,6 +62,7 @@ class QWaylandXCompositeGLXIntegration : public QWaylandGLIntegration
~QWaylandXCompositeGLXIntegration();

void initialize();
bool waitingForEvents() { return !mDisplay; }

QWaylandWindow *createEglWindow(QWindow *window);
QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/platforms/wayland/qwaylanddisplay.cpp
Expand Up @@ -158,6 +158,10 @@ QWaylandDisplay::QWaylandDisplay(void)

#ifdef QT_WAYLAND_GL_SUPPORT
mEglIntegration->initialize();

flushRequests();
while (mEglIntegration->waitingForEvents())
blockingReadEvents();
#endif

waitForScreens();
Expand Down

0 comments on commit b30f9e8

Please sign in to comment.