summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xlib/qxlibwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xlib/qxlibwindow.cpp')
-rw-r--r--src/plugins/platforms/xlib/qxlibwindow.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/plugins/platforms/xlib/qxlibwindow.cpp b/src/plugins/platforms/xlib/qxlibwindow.cpp
index eeb028d359..635caf81f8 100644
--- a/src/plugins/platforms/xlib/qxlibwindow.cpp
+++ b/src/plugins/platforms/xlib/qxlibwindow.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -87,6 +87,8 @@ QXlibWindow::QXlibWindow(QWindow *window)
#if !defined(QT_OPENGL_ES_2)
XVisualInfo *visualInfo = qglx_findVisualInfo(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber(),
window->format());
+ if (!visualInfo)
+ qFatal("Could not initialize GLX");
#else
QPlatformWindowFormat windowFormat = correctColorBuffers(window->platformWindowFormat());
@@ -101,23 +103,22 @@ QXlibWindow::QXlibWindow(QWindow *window)
XVisualInfo *visualInfo;
int matchingCount = 0;
visualInfo = XGetVisualInfo(mScreen->display()->nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
+ if (!visualInfo)
+ qFatal("Could not initialize EGL");
#endif //!defined(QT_OPENGL_ES_2)
- if (visualInfo) {
- mDepth = visualInfo->depth;
- mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
- mVisual = visualInfo->visual;
- Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(), mScreen->rootWindow(), visualInfo->visual, AllocNone);
-
- XSetWindowAttributes a;
- a.background_pixel = WhitePixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
- a.border_pixel = BlackPixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
- a.colormap = cmap;
- x_window = XCreateWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),x, y, w, h,
- 0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWBackPixel|CWBorderPixel|CWColormap, &a);
- } else {
- qFatal("no window!");
- }
+ mDepth = visualInfo->depth;
+ mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ mVisual = visualInfo->visual;
+ Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(), mScreen->rootWindow(), visualInfo->visual, AllocNone);
+
+ XSetWindowAttributes a;
+ a.background_pixel = WhitePixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
+ a.border_pixel = BlackPixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
+ a.colormap = cmap;
+ x_window = XCreateWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),x, y, w, h,
+ 0, visualInfo->depth, InputOutput, visualInfo->visual,
+ CWBackPixel|CWBorderPixel|CWColormap, &a);
+ XFree(visualInfo);
} else
#endif //!defined(QT_NO_OPENGL)
{