2017-03-15 16:47:13 +00:00
|
|
|
/********************************************************************
|
|
|
|
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/>.
|
|
|
|
*********************************************************************/
|
2018-11-05 09:40:39 +00:00
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2017-03-15 16:47:13 +00:00
|
|
|
var logoutEffect = {
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
inDuration: animationTime(800),
|
|
|
|
outDuration: animationTime(400),
|
2017-03-15 16:47:13 +00:00
|
|
|
loadConfig: function () {
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
logoutEffect.inDuration = animationTime(800);
|
|
|
|
logoutEffect.outDuration = animationTime(400);
|
2017-03-15 16:47:13 +00:00
|
|
|
},
|
|
|
|
isLogoutWindow: function (window) {
|
2018-08-14 16:38:10 +00:00
|
|
|
if (window.windowClass === "ksmserver ksmserver") {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (window.windowClass === "ksmserver-logout-greeter ksmserver-logout-greeter") {
|
2017-03-15 16:47:13 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
opened: function (window) {
|
|
|
|
if (!logoutEffect.isLogoutWindow(window)) {
|
|
|
|
return;
|
|
|
|
}
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
// If the Out animation is still active, kill it.
|
|
|
|
if (window.outAnimation !== undefined) {
|
|
|
|
cancel(window.outAnimation);
|
|
|
|
delete window.outAnimation;
|
|
|
|
}
|
|
|
|
window.inAnimation = animate({
|
2017-03-15 16:47:13 +00:00
|
|
|
window: window,
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
duration: logoutEffect.inDuration,
|
2017-03-15 16:47:13 +00:00
|
|
|
type: Effect.Opacity,
|
|
|
|
from: 0.0,
|
|
|
|
to: 1.0
|
|
|
|
});
|
|
|
|
},
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
closed: function (window) {
|
|
|
|
if (!logoutEffect.isLogoutWindow(window)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// If the In animation is still active, kill it.
|
|
|
|
if (window.inAnimation !== undefined) {
|
|
|
|
cancel(window.inAnimation);
|
|
|
|
delete window.inAnimation;
|
|
|
|
}
|
|
|
|
window.outAnimation = animate({
|
|
|
|
window: window,
|
|
|
|
duration: logoutEffect.outDuration,
|
|
|
|
type: Effect.Opacity,
|
|
|
|
from: 1.0,
|
|
|
|
to: 0.0
|
|
|
|
});
|
|
|
|
},
|
2017-03-15 16:47:13 +00:00
|
|
|
init: function () {
|
|
|
|
logoutEffect.loadConfig();
|
|
|
|
effects.windowAdded.connect(logoutEffect.opened);
|
|
|
|
effects.windowShown.connect(logoutEffect.opened);
|
[effects/logout] Animate the disappearing of the logout screen
Summary:
Currently, the fade effect animates both the appearing and the
disappearing of the logout screen. We don't want that because
the logout effect should do that.
D14582 addresses that problem by adding "ksmserver ksmserver" window
class to the blacklist of the fade effect. With that change, only the
logout effect animates the appearing of the logout screen. But there is
a problem... If user clicks the cancel button, the logout screen
instantaneously disappears, instead of smoothly fading out.
This change addresses that problem by adding "out" animation.
Depends on D14582
Test Plan:
{F6175011}
//Now, only the logout effect animates the appearing and the disappearing of the logout screen.//
{F6175013}
//No smooth transitions when the logout effect is disabled.//
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14592
2018-08-04 09:04:58 +00:00
|
|
|
effects.windowClosed.connect(logoutEffect.closed);
|
|
|
|
effects.windowHidden.connect(logoutEffect.closed);
|
2017-03-15 16:47:13 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
logoutEffect.init();
|
|
|
|
|