From 1130c3878f92f5ba2b60689465686e1d825de409 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 11 Feb 2020 19:04:26 +0200 Subject: [PATCH] [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 --- .../package/contents/code/morphingpopups.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/effects/morphingpopups/package/contents/code/morphingpopups.js b/effects/morphingpopups/package/contents/code/morphingpopups.js index 98c167d666..2eec1ef213 100644 --- a/effects/morphingpopups/package/contents/code/morphingpopups.js +++ b/effects/morphingpopups/package/contents/code/morphingpopups.js @@ -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();