new logout effect

Summary:
new logout effect: it's just a slow fade in of the logout
greeter (window is usable immediately tough

Test Plan: logout greeter now fades in without setting the window opacity manually

Reviewers: graesslin, #plasma

Reviewed By: graesslin, #plasma

Subscribers: broulik, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5045
This commit is contained in:
Marco Martin 2017-03-15 17:47:13 +01:00
parent 898bee614d
commit a7b7ce9ec0
7 changed files with 93 additions and 0 deletions

View file

@ -116,6 +116,7 @@ void TestPluginEffectLoader::testHasEffect_data()
QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << false;
QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << false;
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << false;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << false;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << false;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << false;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << false;

View file

@ -135,6 +135,7 @@ void TestScriptedEffectLoader::testHasEffect_data()
QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true;
QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true;
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << true;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true;
@ -165,6 +166,7 @@ void TestScriptedEffectLoader::testKnownEffects()
<< QStringLiteral("kwin4_effect_fade")
<< QStringLiteral("kwin4_effect_fadedesktop")
<< QStringLiteral("kwin4_effect_login")
<< QStringLiteral("kwin4_effect_logout")
<< QStringLiteral("kwin4_effect_maximize")
<< QStringLiteral("kwin4_effect_scalein")
<< QStringLiteral("kwin4_effect_translucency");
@ -190,6 +192,7 @@ void TestScriptedEffectLoader::testLoadEffect_data()
QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true;
QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true;
QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true;
QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true;
QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true;
QTest::newRow("ScaleIn") << QStringLiteral("kwin4_effect_scalein") << true;
QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true;
@ -340,6 +343,7 @@ void TestScriptedEffectLoader::testLoadAllEffects()
plugins.writeEntry(kwin4 + QStringLiteral("fadeEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("fadedesktopEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("loginEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("logoutEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("maximizeEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("minimizeanimationEnabled"), false);
plugins.writeEntry(kwin4 + QStringLiteral("scaleinEnabled"), false);

View file

@ -133,6 +133,7 @@ add_subdirectory( eyeonscreen )
add_subdirectory( fade )
add_subdirectory( fadedesktop )
add_subdirectory( login )
add_subdirectory( logout )
add_subdirectory( maximize )
add_subdirectory( morphingpopups )
add_subdirectory( scalein )

View file

@ -0,0 +1 @@
add_subdirectory(package)

View file

@ -0,0 +1,6 @@
install(DIRECTORY contents DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_logout)
install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effects/kwin4_effect_logout)
install(FILES metadata.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME}
RENAME kwin4_effect_logout.desktop)

View file

@ -0,0 +1,58 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org>
Copyright (C) 2017 Marco Martin <mart@kde.org>
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 <http://www.gnu.org/licenses/>.
*********************************************************************/
/*global effect, effects, animate, animationTime, Effect*/
var logoutEffect = {
duration: animationTime(800),
loadConfig: function () {
"use strict";
logoutEffect.duration = animationTime(800);
},
isLogoutWindow: function (window) {
"use strict";
var windowClass = window.windowClass;
if (windowClass === "ksmserver ksmserver") {
return true;
}
return false;
},
opened: function (window) {
"use strict";
if (!logoutEffect.isLogoutWindow(window)) {
return;
}
animate({
window: window,
duration: logoutEffect.duration,
type: Effect.Opacity,
from: 0.0,
to: 1.0
});
},
init: function () {
"use strict";
logoutEffect.loadConfig();
effects.windowAdded.connect(logoutEffect.opened);
effects.windowShown.connect(logoutEffect.opened);
}
};
logoutEffect.init();

View file

@ -0,0 +1,22 @@
[Desktop Entry]
Name=logout
Icon=preferences-system-windows-effect-logout
Comment=Smoothly fade to the desktop when logging in
Type=Service
X-KDE-ServiceTypes=KWin/Effect,KCModule
X-KDE-PluginInfo-Author=Lubos Lunak, Kai Uwe Broulik, Martin Gräßlin, Marco MArtin
X-KDE-PluginInfo-Email=l.lunak@kde.org, kde@privat.broulik.de, mgraesslin@kde.org, mart@kde.org
X-KDE-PluginInfo-Name=kwin4_effect_logout
X-KDE-PluginInfo-Version=0.2.0
X-KDE-PluginInfo-Category=Appearance
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-KDE-Ordering=40
X-Plasma-API=javascript
X-Plasma-MainScript=code/main.js
X-KDE-PluginKeyword=kwin4_effect_logout
X-KDE-Library=kcm_kwin4_genericscripted
X-KDE-ParentComponents=kwin4_effect_logout
X-KWin-Config-TranslationDomain=kwin_effects