Options now longer provides list of effects to be loaded.

Instead, EffectsHandler itself loads the list of enabled effects (saved by the effects selector widget),
  also making use of their EnabledByDefault property, so if you haven't touched the config, you'll
  automatically get default effects.

svn path=/trunk/KDE/kdebase/workspace/; revision=669036
icc-effect-5.14.5
Rivo Laks 2007-05-28 11:23:00 +00:00
parent 041673bf86
commit 44b293211c
5 changed files with 21 additions and 5 deletions

View File

@ -40,6 +40,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type)
: EffectsHandler(type)
, keyboard_grab_effect( NULL )
{
reconfigure();
}
EffectsHandlerImpl::~EffectsHandlerImpl()
@ -52,6 +53,24 @@ EffectsHandlerImpl::~EffectsHandlerImpl()
XDestroyWindow( display(), pos.second );
}
void EffectsHandlerImpl::reconfigure()
{
KSharedConfig::Ptr _config = KGlobal::config();
KConfigGroup conf(_config, "Plugins");
KService::List offers = KServiceTypeTrader::self()->query("KWin/Effect");
foreach( KService::Ptr service, offers )
{
KPluginInfo plugininfo( service );
plugininfo.load( &conf );
if( plugininfo.isPluginEnabled() )
loadEffect( plugininfo.pluginName() );
else
unloadEffect( plugininfo.pluginName() );
}
}
// the idea is that effects call this function again which calls the next one
void EffectsHandlerImpl::prePaintScreen( int* mask, QRegion* region, int time )
{

View File

@ -84,6 +84,7 @@ class EffectsHandlerImpl : public EffectsHandler
virtual void reserveElectricBorderSwitching( bool reserve );
virtual unsigned long xrenderBufferPicture();
virtual void reconfigure();
// internal (used by kwin core or compositing code)
void startPaint();

View File

@ -226,6 +226,7 @@ class KWIN_EXPORT EffectsHandler
CompositingType compositingType() const { return compositing_type; }
virtual unsigned long xrenderBufferPicture() = 0;
virtual void reconfigure() = 0;
protected:

View File

@ -211,9 +211,6 @@ unsigned long Options::updateSettings()
glAlwaysRebind = config.readEntry("GLAlwaysRebind", false );
glDirect = config.readEntry("GLDirect", true );
glVSync = config.readEntry("GLVSync", true );
config.changeGroup( "Effects" );
defaultEffects = config.readEntry( "Load", QStringList() << "ShowFps" << "Fade" );
// Read button tooltip animation effect from kdeglobals
// Since we want to allow users to enable window decoration tooltips

View File

@ -319,8 +319,6 @@ class Options : public KDecorationOptions
bool glDirect;
bool glVSync;
QStringList defaultEffects;
private:
WindowOperation OpTitlebarDblClick;