From 85e46eead69c726e6a10572daf3bd54290a084c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 26 Sep 2007 13:47:01 +0000 Subject: [PATCH] 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 --- compositingprefs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index ed150d94bc..b83752c698 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms. #include "utils.h" #include +#include namespace KWin @@ -51,6 +52,7 @@ void CompositingPrefs::detect() bool CompositingPrefs::createGLXContext() { #ifdef HAVE_OPENGL + KXErrorHandler handler; // Most of this code has been taken from glxinfo.c QVector attribs; attribs << GLX_RGBA; @@ -92,7 +94,7 @@ bool CompositingPrefs::createGLXContext() 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr ); - return glXMakeCurrent( display(), mGLWindow, mGLContext ); + return glXMakeCurrent( display(), mGLWindow, mGLContext ) && !handler.error( true ); #else return false; #endif