From af80a546bfe258b54468b159bb8cf78f16ca9ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 24 Aug 2016 10:02:45 +0200 Subject: [PATCH] [effects] Drop the logout effect Summary: The new logout design doesn't want to have the vignetting. Thus the logout effect itself doesn't make any sense any more. All that would still be used is the logout blur which can also be provided by the blur effect nowadays for fullscreen windows. As the new logout is a fullscreen window it should use that one. The logout effect did one more thing: it kept the vignetting and the blur once the user selected logout. Now without the vignetting this would be weird and again doesn't make much sense any more. So overall I think it's better to just drop the logout effect and use blur effect in normal way. Neat side advantage: it will also work on Wayland out-of-the-box. Reviewers: #kwin, #plasma, #vdg Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2553 --- autotests/test_builtin_effectloader.cpp | 5 - autotests/test_plugin_effectloader.cpp | 1 - effects/CMakeLists.txt | 1 - effects/effect_builtins.cpp | 16 - effects/effect_builtins.h | 1 - effects/logout/CMakeLists.txt | 9 - effects/logout/data/1.10/vignetting.frag | 8 - effects/logout/data/1.40/vignetting.frag | 12 - effects/logout/logout.cpp | 387 ----------------------- effects/logout/logout.h | 103 ------ effects/logout/logout.kcfg | 12 - effects/logout/logoutconfig.kcfgc | 5 - effects/shaders.qrc | 2 - 13 files changed, 562 deletions(-) delete mode 100644 effects/logout/CMakeLists.txt delete mode 100644 effects/logout/data/1.10/vignetting.frag delete mode 100644 effects/logout/data/1.40/vignetting.frag delete mode 100644 effects/logout/logout.cpp delete mode 100644 effects/logout/logout.h delete mode 100644 effects/logout/logout.kcfg delete mode 100644 effects/logout/logoutconfig.kcfgc diff --git a/autotests/test_builtin_effectloader.cpp b/autotests/test_builtin_effectloader.cpp index 8100bff978..689cd2b58a 100644 --- a/autotests/test_builtin_effectloader.cpp +++ b/autotests/test_builtin_effectloader.cpp @@ -93,7 +93,6 @@ void TestBuiltInEffectLoader::testHasEffect_data() QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << true; QTest::newRow("Invert") << QStringLiteral("invert") << true; QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true; - QTest::newRow("Logout") << QStringLiteral("logout") << true; QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << true; QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << true; QTest::newRow("Magnifier") << QStringLiteral("magnifier") << true; @@ -149,7 +148,6 @@ void TestBuiltInEffectLoader::testKnownEffects() << QStringLiteral("highlightwindow") << QStringLiteral("invert") << QStringLiteral("kscreen") - << QStringLiteral("logout") << QStringLiteral("lookingglass") << QStringLiteral("magiclamp") << QStringLiteral("magnifier") @@ -223,7 +221,6 @@ void TestBuiltInEffectLoader::testSupported_data() QTest::newRow("Invert") << QStringLiteral("invert") << false << xc << true; QTest::newRow("Invert-GL") << QStringLiteral("invert") << true << oc << true; QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true << xc << true; - QTest::newRow("Logout") << QStringLiteral("logout") << true << xc << true; QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false << xc << true; QTest::newRow("LookingGlass-GL") << QStringLiteral("lookingglass") << true << oc << true; QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << false << xc << true; @@ -311,7 +308,6 @@ void TestBuiltInEffectLoader::testLoadEffect_data() QTest::newRow("Invert") << QStringLiteral("invert") << false << xc; QTest::newRow("Invert-GL") << QStringLiteral("invert") << true << oc; QTest::newRow("Kscreen") << QStringLiteral("kscreen") << true << xc; - QTest::newRow("Logout") << QStringLiteral("logout") << true << xc; QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false << xc; QTest::newRow("LookingGlass-GL") << QStringLiteral("lookingglass") << true << oc; QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << false << xc; @@ -501,7 +497,6 @@ void TestBuiltInEffectLoader::testLoadAllEffects() plugins.writeEntry(QStringLiteral("desktopgridEnabled"), false); plugins.writeEntry(QStringLiteral("highlightwindowEnabled"), false); plugins.writeEntry(QStringLiteral("kscreenEnabled"), false); - plugins.writeEntry(QStringLiteral("logoutEnabled"), false); plugins.writeEntry(QStringLiteral("minimizeanimationEnabled"), false); plugins.writeEntry(QStringLiteral("presentwindowsEnabled"), false); plugins.writeEntry(QStringLiteral("screenedgeEnabled"), false); diff --git a/autotests/test_plugin_effectloader.cpp b/autotests/test_plugin_effectloader.cpp index 208471d92f..f010847f2d 100644 --- a/autotests/test_plugin_effectloader.cpp +++ b/autotests/test_plugin_effectloader.cpp @@ -86,7 +86,6 @@ void TestPluginEffectLoader::testHasEffect_data() QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << false; QTest::newRow("Invert") << QStringLiteral("invert") << false; QTest::newRow("Kscreen") << QStringLiteral("kscreen") << false; - QTest::newRow("Logout") << QStringLiteral("logout") << false; QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false; QTest::newRow("MagicLamp") << QStringLiteral("magiclamp") << false; QTest::newRow("Magnifier") << QStringLiteral("magnifier") << false; diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index 0fec45556a..f67d7763a9 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -158,7 +158,6 @@ include( slidingpopups/CMakeLists.txt ) add_subdirectory( thumbnailaside ) add_subdirectory( windowgeometry ) add_subdirectory( zoom ) -include( logout/CMakeLists.txt ) # OpenGL-specific effects add_subdirectory( blur ) diff --git a/effects/effect_builtins.cpp b/effects/effect_builtins.cpp index b09b481851..ea16a6e220 100644 --- a/effects/effect_builtins.cpp +++ b/effects/effect_builtins.cpp @@ -44,7 +44,6 @@ along with this program. If not, see . #include "touchpoints/touchpoints.h" #include "windowgeometry/windowgeometry.h" #include "zoom/zoom.h" -#include "logout/logout.h" // OpenGL-specific effects for desktop #include "coverswitch/coverswitch.h" #include "cube/cube.h" @@ -306,21 +305,6 @@ EFFECT_FALLBACK nullptr, nullptr #endif -EFFECT_FALLBACK - }, { - QStringLiteral("logout"), - i18ndc("kwin_effects", "Name of a KWin Effect", "Logout"), - i18ndc("kwin_effects", "Comment describing the KWin Effect", "Desaturate the desktop when displaying the logout dialog"), - QStringLiteral("Appearance"), - QString(), - QUrl(), - true, - false, -#ifdef EFFECT_BUILTINS - &createHelper, - nullptr, - nullptr -#endif EFFECT_FALLBACK }, { QStringLiteral("lookingglass"), diff --git a/effects/effect_builtins.h b/effects/effect_builtins.h index de584e3a0f..7f163fa18a 100644 --- a/effects/effect_builtins.h +++ b/effects/effect_builtins.h @@ -48,7 +48,6 @@ enum class BuiltInEffect HighlightWindow, Invert, Kscreen, - Logout, LookingGlass, MagicLamp, Magnifier, diff --git a/effects/logout/CMakeLists.txt b/effects/logout/CMakeLists.txt deleted file mode 100644 index 0a49a30567..0000000000 --- a/effects/logout/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -####################################### -# Effect - -# Source files -set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources} - logout/logout.cpp - ) - -kconfig_add_kcfg_files(kwin4_effect_builtins_sources logout/logoutconfig.kcfgc) diff --git a/effects/logout/data/1.10/vignetting.frag b/effects/logout/data/1.10/vignetting.frag deleted file mode 100644 index 5d034a845d..0000000000 --- a/effects/logout/data/1.10/vignetting.frag +++ /dev/null @@ -1,8 +0,0 @@ -uniform vec2 u_center; -uniform float u_radius; -uniform float u_progress; - -void main() { - float d = smoothstep(0, u_radius, distance(gl_FragCoord.xy, u_center)); - gl_FragColor = vec4(0.0, 0.0, 0.0, d * u_progress); -} diff --git a/effects/logout/data/1.40/vignetting.frag b/effects/logout/data/1.40/vignetting.frag deleted file mode 100644 index af25ae3395..0000000000 --- a/effects/logout/data/1.40/vignetting.frag +++ /dev/null @@ -1,12 +0,0 @@ -#version 140 - -uniform vec2 u_center; -uniform float u_radius; -uniform float u_progress; - -out vec4 fragColor; - -void main() { - float d = smoothstep(0, u_radius, distance(gl_FragCoord.xy, u_center)); - fragColor = vec4(0.0, 0.0, 0.0, d * u_progress); -} diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp deleted file mode 100644 index 0a0df45661..0000000000 --- a/effects/logout/logout.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2007 Lubos Lunak -Copyright (C) 2009 Martin Gräßlin -Copyright (C) 2009, 2010 Lucas Murray - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#include "logout.h" -// KConfigSkeleton -#include "logoutconfig.h" - -#include "kwinglutils.h" -#include "kwinglplatform.h" - -#include - -#include -#include -#include - -namespace KWin -{ - -WindowAttributes::WindowAttributes(const WindowPaintData &data) -{ - opacity = data.opacity(); - rotation = data.rotationAngle(); - rotationAxis = data.rotationAxis(); - rotationOrigin = data.rotationOrigin(); - scale = QVector3D(data.xScale(), data.yScale(), data.zScale()); - translation = data.translation(); -} - -void WindowAttributes::applyTo(WindowPaintData &data) const -{ - data.setOpacity(opacity); - data.translate(translation); - data.setScale(scale); - data.setRotationAngle(rotation); - data.setRotationAxis(rotationAxis); - data.setRotationOrigin(rotationOrigin); -} - -LogoutEffect::LogoutEffect() - : progress(0.0) - , displayEffect(false) - , logoutWindow(NULL) - , logoutWindowClosed(true) - , logoutWindowPassed(false) - , logoutAtom(QByteArrayLiteral("_KDE_LOGGING_OUT")) - , canDoPersistent(false) - , ignoredWindows() - , m_vignettingShader(NULL) - , m_blurShader(NULL) -{ - if (logoutAtom.isValid()) { - // Persistent effect - effects->registerPropertyType(logoutAtom, true); - } - - blurTexture = NULL; - blurTarget = NULL; - reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); -} - -LogoutEffect::~LogoutEffect() -{ - delete blurTexture; - delete blurTarget; - delete m_vignettingShader; - delete m_blurShader; -} - -void LogoutEffect::reconfigure(ReconfigureFlags) -{ - LogoutConfig::self()->read(); - frameDelay = 0; - useBlur = LogoutConfig::useBlur(); - delete blurTexture; - blurTexture = NULL; - delete blurTarget; - blurTarget = NULL; - blurSupported = false; - delete m_blurShader; - m_blurShader = NULL; -} - -void LogoutEffect::prePaintScreen(ScreenPrePaintData& data, int time) -{ - if (!displayEffect && progress == 0.0) { - if (blurTexture) { - delete blurTexture; - blurTexture = NULL; - delete blurTarget; - blurTarget = NULL; - blurSupported = false; - } - } else if (!blurTexture) { - blurSupported = false; - delete blurTarget; // catch as we just tested the texture ;-P - if (effects->isOpenGLCompositing() && GLRenderTarget::blitSupported() && !GLPlatform::instance()->supports(LimitedNPOT) && 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 - const QSize size = effects->virtualScreenSize(); - - // The fragment shader uses a LOD bias of 1.75, so we need 3 mipmap levels. - blurTexture = new GLTexture(GL_RGBA8, size, 3); - blurTexture->setFilter(GL_LINEAR_MIPMAP_LINEAR); - blurTexture->setWrapMode(GL_CLAMP_TO_EDGE); - - blurTarget = new GLRenderTarget(*blurTexture); - if (blurTarget->valid()) - blurSupported = true; - - // As creating the render target takes time it can cause the first two frames of the - // blur animation to be jerky. For this reason we only start the animation after the - // third frame. - frameDelay = 2; - } - } - - if (frameDelay) - --frameDelay; - else { - if (displayEffect) - progress = qMin(1.0, progress + time / animationTime(2000.0)); - else if (progress > 0.0) - progress = qMax(0.0, progress - time / animationTime(500.0)); - } - - if (blurSupported && progress > 0.0) { - data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; - } - - data.paint |= effects->clientArea(FullArea, 0, 0); - effects->prePaintScreen(data, time); -} - -void LogoutEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) -{ - if (progress > 0.0) { - // HACK: All windows past the first ignored one should not be - // blurred as it affects the stacking order. - // All following windows are on top of the logout window and should not be altered either - logoutWindowPassed = (logoutWindowPassed || w == logoutWindow || ignoredWindows.contains(w)); - - if (effects->isOpenGLCompositing()) { - // In OpenGL mode we add vignetting and, if supported, a slight blur - if (blurSupported) { - // When using blur we render everything to an FBO and as such don't do the vignetting - // until after we render the FBO to the screen. - if (logoutWindowPassed) { // Window is rendered after the FBO - m_windows.append(WinDataPair(w, WindowAttributes(data))); - return; // we paint this in ::paintScreen(), so cut the line here - } else { // Window is added to the FBO - data.multiplySaturation((1.0 - progress * 0.2)); - } - } else { - // If we are not blurring then we are not rendering to an FBO - if (w == logoutWindow) { - // This is the logout window don't alter it but render our vignetting now - renderVignetting(data.screenProjectionMatrix()); - } else if (logoutWindowPassed) { // Window is in the background, desaturate - data.multiplySaturation((1.0 - progress * 0.2)); - } // else ... All other windows are unaltered - } - } - if (effects->compositingType() == KWin::XRenderCompositing) { - // Since we can't do vignetting in XRender just do a stronger desaturation and darken - if (!logoutWindowPassed) { - data.multiplySaturation((1.0 - progress * 0.8)); - data.multiplyBrightness((1.0 - progress * 0.3)); - } - } - } - effects->paintWindow(w, mask, region, data); -} - -void LogoutEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) -{ - effects->paintScreen(mask, region, data); - - if (effects->isOpenGLCompositing() && progress > 0.0) { - if (!blurSupported) { - if (!logoutWindowPassed) - // The logout window has been deleted but we still want to fade out the vignetting, thus - // render it on the top of everything if still animating. We don't check if logoutWindow - // is set as it may still be even if it wasn't rendered. - renderVignetting(data.projectionMatrix()); - } else { - GLRenderTarget::pushRenderTarget(blurTarget); - blurTarget->blitFromFramebuffer(); - GLRenderTarget::popRenderTarget(); - - //-------------------------- - // Render the screen effect - renderBlurTexture(data.projectionMatrix()); - - // Vignetting (Radial gradient with transparent middle and black edges) - renderVignetting(data.projectionMatrix()); - //-------------------------- - - // Render the logout window and all windows on top - for (int i = 0; i < m_windows.count(); ++i) { - EffectWindow *w = m_windows.at(i).first; - int winMask = PAINT_WINDOW_TRANSLUCENT|PAINT_WINDOW_TRANSFORMED; - WindowPaintData wdata(w); - m_windows.at(i).second.applyTo(wdata); - wdata *= QVector3D(data.xScale(), data.yScale(), data.zScale()); - wdata.translate(data.translation()); - wdata.translate((data.xScale()-1)*w->x(), (data.yScale()-1)*w->y(), 0); - effects->drawWindow(w, winMask, region, wdata); - } - m_windows.clear(); - } - } -} - -void LogoutEffect::postPaintScreen() -{ - if ((progress != 0.0 && progress != 1.0) || frameDelay) - effects->addRepaintFull(); - - if (progress > 0.0) - logoutWindowPassed = false; - effects->postPaintScreen(); -} - -void LogoutEffect::slotWindowAdded(EffectWindow* w) -{ - if (isLogoutDialog(w)) { - logoutWindow = w; - logoutWindowClosed = false; // So we don't blur the window on close - progress = 0.0; - displayEffect = true; - ignoredWindows.clear(); - effects->addRepaintFull(); - } else if (canDoPersistent) - // TODO: Add parent - ignoredWindows.append(w); -} - -void LogoutEffect::slotWindowClosed(EffectWindow* w) -{ - if (w == logoutWindow) { - logoutWindowClosed = true; - if (!canDoPersistent) - displayEffect = false; // Fade back to normal - effects->addRepaintFull(); - } -} - -void LogoutEffect::slotWindowDeleted(EffectWindow* w) -{ - QList::iterator it = m_windows.begin(); - while (it != m_windows.end()) { - if (it->first == w) - it = m_windows.erase(it); - else - ++it; - } - ignoredWindows.removeAll(w); - if (w == logoutWindow) - logoutWindow = nullptr; -} - -bool LogoutEffect::isLogoutDialog(EffectWindow* w) -{ - // TODO there should be probably a better way (window type?) - if (w->windowClass() == QStringLiteral("ksmserver ksmserver") - && (w->windowRole() == QStringLiteral("logoutdialog") || w->windowRole() == QStringLiteral("logouteffect"))) { - return true; - } - return false; -} - -void LogoutEffect::renderVignetting(const QMatrix4x4 &projection) -{ - if (!m_vignettingShader) { - m_vignettingShader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait(), QString(), QStringLiteral("vignetting.frag")); - if (!m_vignettingShader->isValid()) { - qCDebug(KWINEFFECTS) << "Vignetting Shader failed to load"; - return; - } - } else if (!m_vignettingShader->isValid()) { - // shader broken - return; - } - ShaderBinder binder(m_vignettingShader); - m_vignettingShader->setUniform(KWin::GLShader::ModelViewProjectionMatrix, projection); - m_vignettingShader->setUniform("u_progress", (float)progress * 0.9f); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_SCISSOR_TEST); - const QRect fullArea = effects->clientArea(FullArea, 0, 0); - for (int screen = 0; screen < effects->numScreens(); screen++) { - const QRect screenGeom = effects->clientArea(ScreenArea, screen, 0); - glScissor(screenGeom.x(), effects->virtualScreenSize().height() - screenGeom.y() - screenGeom.height(), - screenGeom.width(), screenGeom.height()); // GL coords are flipped - const float cenX = screenGeom.x() + screenGeom.width() / 2; - const float cenY = fullArea.height() - screenGeom.y() - screenGeom.height() / 2; - const float r = float((screenGeom.width() > screenGeom.height()) - ? screenGeom.width() : screenGeom.height()) * 0.8f; // Radius - m_vignettingShader->setUniform("u_center", QVector2D(cenX, cenY)); - m_vignettingShader->setUniform("u_radius", r); - QVector vertices; - vertices << screenGeom.x() << screenGeom.y(); - vertices << screenGeom.x() << screenGeom.y() + screenGeom.height(); - vertices << screenGeom.x() + screenGeom.width() << screenGeom.y(); - vertices << screenGeom.x() + screenGeom.width() << screenGeom.y() + screenGeom.height(); - GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); - vbo->setData(vertices.count()/2, 2, vertices.constData(), NULL); - vbo->render(GL_TRIANGLE_STRIP); - } - glDisable(GL_SCISSOR_TEST); - glDisable(GL_BLEND); -} - -void LogoutEffect::renderBlurTexture(const QMatrix4x4 &projection) -{ - if (!m_blurShader) { - m_blurShader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait::MapTexture, QString(), QStringLiteral("logout-blur.frag")); - if (!m_blurShader->isValid()) { - qCDebug(KWINEFFECTS) << "Logout blur shader failed to load"; - } - } - if (!m_blurShader->isValid()) { - // shader is broken - no need to continue here - return; - } - // Unmodified base image - ShaderBinder binder(m_blurShader); - m_blurShader->setUniform(GLShader::ModelViewProjectionMatrix, projection); - m_blurShader->setUniform("u_alphaProgress", (float)progress * 0.4f); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - blurTexture->bind(); - blurTexture->generateMipmaps(); - blurTexture->render(infiniteRegion(), effects->virtualScreenGeometry()); - blurTexture->unbind(); - glDisable(GL_BLEND); -} - -void LogoutEffect::slotPropertyNotify(EffectWindow* w, long a) -{ - if (w || a != logoutAtom) - return; // Not our atom - - QByteArray byteData = effects->readRootProperty(logoutAtom, logoutAtom, 8); - if (byteData.length() < 1) { - // Property was deleted - displayEffect = false; - return; - } - - // We are using a compatible KSMServer therefore only terminate the effect when the - // atom is deleted, not when the dialog is closed. - canDoPersistent = true; - effects->addRepaintFull(); -} - -bool LogoutEffect::isActive() const -{ - return progress != 0 || logoutWindow; -} - -} // namespace diff --git a/effects/logout/logout.h b/effects/logout/logout.h deleted file mode 100644 index db04e9d92e..0000000000 --- a/effects/logout/logout.h +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2007 Lubos Lunak -Copyright (C) 2009 Martin Gräßlin -Copyright (C) 2009, 2010 Lucas Murray - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -#ifndef KWIN_LOGOUT_H -#define KWIN_LOGOUT_H - -#include -#include - - -namespace KWin -{ - -class GLRenderTarget; -class GLTexture; - -class WindowAttributes { -public: - WindowAttributes(const WindowPaintData &data); - void applyTo(WindowPaintData &data) const; - qreal opacity = 1.0; - qreal rotation = 0.0; - QVector3D rotationAxis; - QVector3D rotationOrigin; - QVector3D scale = QVector3D(1,1,1); - QVector3D translation; -}; - -class LogoutEffect - : public Effect -{ - Q_OBJECT - Q_PROPERTY(bool useBlur READ isUseBlur) -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(); - virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); - virtual bool isActive() const; - - int requestedEffectChainPosition() const override { - return 85; - } - - // for properties - bool isUseBlur() const { - return useBlur; - } -public Q_SLOTS: - void slotWindowAdded(KWin::EffectWindow* w); - void slotWindowClosed(KWin::EffectWindow *w); - void slotWindowDeleted(KWin::EffectWindow *w); - void slotPropertyNotify(KWin::EffectWindow *w, long a); -private: - bool isLogoutDialog(EffectWindow* w); - double progress; // 0-1 - bool displayEffect; - EffectWindow* logoutWindow; - bool logoutWindowClosed; - bool logoutWindowPassed; - - // Persistent effect - Xcb::Atom logoutAtom; - bool canDoPersistent; - EffectWindowList ignoredWindows; - - void renderVignetting(const QMatrix4x4 &projection); - void renderBlurTexture(const QMatrix4x4 &projection); - int frameDelay; - bool blurSupported, useBlur; - GLTexture* blurTexture; - GLRenderTarget* blurTarget; - typedef QPair WinDataPair; - QList m_windows; - GLShader *m_vignettingShader; - GLShader *m_blurShader; -}; - -} // namespace - -#endif diff --git a/effects/logout/logout.kcfg b/effects/logout/logout.kcfg deleted file mode 100644 index ec3b525978..0000000000 --- a/effects/logout/logout.kcfg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - true - - - diff --git a/effects/logout/logoutconfig.kcfgc b/effects/logout/logoutconfig.kcfgc deleted file mode 100644 index 030724ebb2..0000000000 --- a/effects/logout/logoutconfig.kcfgc +++ /dev/null @@ -1,5 +0,0 @@ -File=logout.kcfg -ClassName=LogoutConfig -NameSpace=KWin -Singleton=true -Mutators=true diff --git a/effects/shaders.qrc b/effects/shaders.qrc index e08cd77331..cf19e34c8b 100644 --- a/effects/shaders.qrc +++ b/effects/shaders.qrc @@ -7,7 +7,6 @@ cube/data/1.10/sphere.vert invert/data/1.10/invert.frag logout/data/1.10/logout-blur.frag - logout/data/1.10/vignetting.frag lookingglass/data/1.10/lookingglass.frag startupfeedback/data/blinking-startup-fragment.glsl @@ -19,7 +18,6 @@ cube/data/1.40/sphere.vert invert/data/1.40/invert.frag logout/data/1.40/logout-blur.frag - logout/data/1.40/vignetting.frag lookingglass/data/1.40/lookingglass.frag