diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 0ef390d93a..4dfad56238 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include "kwinglutils.h" +#include #include namespace KWin @@ -44,11 +45,29 @@ LogoutEffect::LogoutEffect() XChangeProperty( display(), sel, hack, hack, 8, PropModeReplace, (unsigned char*)&hack, 1 ); // the atom is not removed when effect is destroyed, this is temporary anyway + reconfigure( ReconfigureAll ); + } + +LogoutEffect::~LogoutEffect() + { +#ifdef KWIN_HAVE_OPENGL_COMPOSITING + delete blurTexture; + delete blurTarget; +#endif + } + +void LogoutEffect::reconfigure( ReconfigureFlags ) + { + // Disable blur by default as some drivers don't correctly fallback if they don't + // support it and I have yet to work out a way of accurately detecting support. + KConfigGroup conf = effects->effectConfig( "Logout" ); + bool useBlur = conf.readEntry( "UseBlur", false ); + #ifdef KWIN_HAVE_OPENGL_COMPOSITING blurSupported = false; blurTexture = NULL; blurTarget = NULL; - if( effects->compositingType() == OpenGLCompositing && GLTexture::NPOTTextureSupported() ) + if( effects->compositingType() == OpenGLCompositing && GLTexture::NPOTTextureSupported() && useBlur ) { // TODO: It seems that it is not possible to create a GLRenderTarget that has // a different size than the display right now. Most likely a KWin core bug. // Create texture and render target @@ -63,14 +82,6 @@ LogoutEffect::LogoutEffect() #endif } -LogoutEffect::~LogoutEffect() - { -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - delete blurTexture; - delete blurTarget; -#endif - } - void LogoutEffect::prePaintScreen( ScreenPrePaintData& data, int time ) { if( logoutWindow != NULL && !logoutWindowClosed ) diff --git a/effects/logout/logout.h b/effects/logout/logout.h index 2c5700bc4c..2b8eea0743 100644 --- a/effects/logout/logout.h +++ b/effects/logout/logout.h @@ -38,6 +38,7 @@ class LogoutEffect public: LogoutEffect(); ~LogoutEffect(); + virtual void reconfigure( ReconfigureFlags ); virtual void prePaintScreen( ScreenPrePaintData& data, int time ); virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data ); virtual void postPaintScreen();