Commit 1130c387 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[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
parent 63b24b55
......@@ -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();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment