Check for X errors during detecting OpenGL (don't let whole KWin startup fail

because of it).


svn path=/trunk/KDE/kdebase/workspace/; revision=717267
This commit is contained in:
Luboš Luňák 2007-09-26 13:47:01 +00:00
parent 5e289c2423
commit 85e46eead6

View file

@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "utils.h" #include "utils.h"
#include <kdebug.h> #include <kdebug.h>
#include <kxerrorhandler.h>
namespace KWin namespace KWin
@ -51,6 +52,7 @@ void CompositingPrefs::detect()
bool CompositingPrefs::createGLXContext() bool CompositingPrefs::createGLXContext()
{ {
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
KXErrorHandler handler;
// Most of this code has been taken from glxinfo.c // Most of this code has been taken from glxinfo.c
QVector<int> attribs; QVector<int> attribs;
attribs << GLX_RGBA; attribs << GLX_RGBA;
@ -92,7 +94,7 @@ bool CompositingPrefs::createGLXContext()
0, visinfo->depth, InputOutput, 0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr ); visinfo->visual, mask, &attr );
return glXMakeCurrent( display(), mGLWindow, mGLContext ); return glXMakeCurrent( display(), mGLWindow, mGLContext ) && !handler.error( true );
#else #else
return false; return false;
#endif #endif