- Add CompositingPrefs::compositingPossible() to check if compositing is supported at all.
- Use it in setupCompositing() svn path=/trunk/KDE/kdebase/workspace/; revision=717330
This commit is contained in:
parent
a3781228cb
commit
68f7504fb0
3 changed files with 32 additions and 11 deletions
|
@ -71,16 +71,11 @@ void Workspace::setupCompositing()
|
|||
kDebug( 1212 ) << "Compositing is turned off in options";
|
||||
return;
|
||||
}
|
||||
if( !Extensions::compositeAvailable())
|
||||
{
|
||||
kDebug( 1212 ) << "No composite extension available";
|
||||
else if( !CompositingPrefs::compositingPossible() )
|
||||
{
|
||||
kDebug( 1212 ) << "Compositing isn't possible";
|
||||
return;
|
||||
}
|
||||
if( !Extensions::damageAvailable())
|
||||
{
|
||||
kDebug( 1212 ) << "No damage extension available";
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( scene != NULL )
|
||||
return;
|
||||
char selection_name[ 100 ];
|
||||
|
|
|
@ -10,8 +10,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
|
||||
#include "compositingprefs.h"
|
||||
|
||||
#include "options.h"
|
||||
#include "utils.h"
|
||||
#include "kwinglobals.h"
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <kxerrorhandler.h>
|
||||
|
@ -30,8 +29,34 @@ CompositingPrefs::~CompositingPrefs()
|
|||
{
|
||||
}
|
||||
|
||||
bool CompositingPrefs::compositingPossible()
|
||||
{
|
||||
#if defined( HAVE_XCOMPOSITE ) && defined( HAVE_XDAMAGE )
|
||||
Extensions::init();
|
||||
if( !Extensions::compositeAvailable())
|
||||
{
|
||||
kDebug( 1212 ) << "No composite extension available";
|
||||
return false;
|
||||
}
|
||||
if( !Extensions::damageAvailable())
|
||||
{
|
||||
kDebug( 1212 ) << "No damage extension available";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CompositingPrefs::detect()
|
||||
{
|
||||
if( !compositingPossible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
// remember and later restore active context
|
||||
GLXContext oldcontext = glXGetCurrentContext();
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
bool operator>=( const Version& v ) const { return ( compare( v ) != -1 ); }
|
||||
};
|
||||
|
||||
static bool compositingPossible();
|
||||
bool enableCompositing() const { return mEnableCompositing; }
|
||||
bool enableVSync() const { return mEnableVSync; }
|
||||
bool enableDirectRendering() const { return mEnableDirectRendering; }
|
||||
|
|
Loading…
Reference in a new issue