From a352c5d3498cf228e2b8f637862e68f87887130d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 5 Jun 2007 12:50:18 +0000 Subject: [PATCH] Fall back to XRender if OpenGL fails. svn path=/trunk/KDE/kdebase/workspace/; revision=671719 --- composite.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/composite.cpp b/composite.cpp index 9f503469fb..2698c77f37 100644 --- a/composite.cpp +++ b/composite.cpp @@ -92,24 +92,28 @@ void Workspace::setupCompositing() case 'B': kDebug( 1212 ) << "X compositing" << endl; scene = new SceneBasic( this ); - break; + break; // don't fall through (this is a testing one) +#ifdef HAVE_OPENGL + case 'O': + kDebug( 1212 ) << "OpenGL compositing" << endl; + scene = new SceneOpenGL( this ); + if( !scene->initFailed()) + break; // --> + delete scene; + scene = NULL; + // fall through, try XRender +#endif #if defined(HAVE_XRENDER) && defined(HAVE_XFIXES) case 'X': kDebug( 1212 ) << "XRender compositing" << endl; scene = new SceneXrender( this ); break; -#endif -#ifdef HAVE_OPENGL - case 'O': - kDebug( 1212 ) << "OpenGL compositing" << endl; - scene = new SceneOpenGL( this ); - break; #endif default: kDebug( 1212 ) << "No compositing" << endl; return; } - if( scene != NULL && scene->initFailed()) + if( scene == NULL || scene->initFailed()) { delete scene; scene = NULL;