[effects/morphingpopups] Start animation on windowFrameGeometryChanged

Summary:
EffectsHandlerImpl::windowFrameGeometryChanged is emitted when the frame
geometry of a window has _actually_ changed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26865
This commit is contained in:
Vlad Zahorodnii 2020-02-11 19:04:26 +02:00
parent 63b24b559a
commit 1130c3878f

View file

@ -26,7 +26,7 @@ var morphingEffect = {
morphingEffect.duration = animationTime(150);
},
geometryChange: function (window, oldGeometry) {
handleFrameGeometryChanged: function (window, oldGeometry) {
//only tooltips and notifications
if (!window.tooltip && !window.notification && !window.criticalNotification) {
return;
@ -38,13 +38,6 @@ var morphingEffect = {
//don't cross the whole screen: ugly
var distance = Math.abs(oldGeometry.x - newGeometry.x) + Math.abs(oldGeometry.y - newGeometry.y);
if (newGeometry.x == oldGeometry.x &&
newGeometry.y == oldGeometry.y &&
newGeometry.width == oldGeometry.width &&
newGeometry.height == oldGeometry.height) {
return;
}
if (distance > (newGeometry.width + newGeometry.height) * 2) {
if (window.moveAnimation) {
delete window.moveAnimation;
@ -137,7 +130,7 @@ var morphingEffect = {
init: function () {
effect.configChanged.connect(morphingEffect.loadConfig);
effects.windowGeometryShapeChanged.connect(morphingEffect.geometryChange);
effects.windowFrameGeometryChanged.connect(morphingEffect.handleFrameGeometryChanged);
}
};
morphingEffect.init();