From 5d8d7b1dbc703c381033681c2cd4f7a912f60850 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 15 Oct 2011 00:17:30 +0300 Subject: Add a warning and a return value to xcb's createGLPlatformContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was no value returned previously when none of GLX, EGL, DRI was enabled. Now we show a warning message and return null (resulting in a crash). Previously not returning a value resulted in obscure crashes with strange-looking call stacks, now it will be clear what the problem is. This is particularly important because not having libx11-xcb-dev installed results in silently disabled xlib support which in turn disallows the usage of glx too. The result is an obscure crash in any GL (e.g. QML2) app. Now there will be a proper warning message at least. Change-Id: I15cf3a6c16ca373d4ada7abb6d3c8f7e30c1e03d Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbintegration.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 91d7e287f3..aa5c7e444b 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -175,6 +175,8 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont #elif defined(XCB_USE_DRI2) return new QDri2Context(context->format(), context->shareHandle()); #endif + qWarning("Cannot create platform GL context, none of GLX, EGL, DRI2 is enabled"); + return 0; } QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const -- cgit v1.2.3