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
This commit is contained in:
Lucas Murray 2008-12-11 13:17:33 +00:00
parent 12ec1a392b
commit 2106401f7d

View file

@ -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;