From 2106401f7d6c31f22a615b85ff231776d12d153e Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Thu, 11 Dec 2008 13:17:33 +0000 Subject: [PATCH] Allow users to manually override indirect OpenGL by setting KWIN_DIRECT_GL=1. This should allow fglrx users to use shader effects. This should really be done automatically by testing to see whether the required extensions are available when in indirect mode first, then falling back to direct mode and trying again. CCBUG: 173556 svn path=/trunk/KDE/kdebase/workspace/; revision=895696 --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 65b827a521..b205135386 100644 --- a/main.cpp +++ b/main.cpp @@ -492,7 +492,8 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) if (signal(SIGHUP, KWin::sighandler) == SIG_IGN) signal(SIGHUP, SIG_IGN); // HACK this is needed for AIGLX - setenv( "LIBGL_ALWAYS_INDIRECT","1", true ); + if( qstrcmp( getenv( "KWIN_DIRECT_GL" ), "1" ) != 0 ) + setenv( "LIBGL_ALWAYS_INDIRECT","1", true ); // HACK this is needed to work around a Qt4.4.0RC1 bug (#157659) setenv( "QT_SLOW_TOPLEVEL_RESIZE", "1", true ); KWin::Application a; @@ -500,6 +501,10 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) KWin::SessionSaveDoneHelper helper; KGlobal::locale()->insertCatalog( "kwin_effects" ); + // Announce when KWIN_DIRECT_GL is set for above HACK + if( qstrcmp( getenv( "KWIN_DIRECT_GL" ), "1" ) == 0 ) + kDebug( 1212 ) << "KWIN_DIRECT_GL set, not forcing LIBGL_ALWAYS_INDIRECT=1"; + fcntl(XConnectionNumber(KWin::display()), F_SETFD, 1); QString appname;