Blob Blame History Raw
From ce368a83a782931c56239daa99e3dc96d1de41e2 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 7 Feb 2019 14:27:35 -0500
Subject: [PATCH] windowManager: ensure actor resize clone dies with actor

If a window gets destroyed right before it's resize
animation starts the user can get confronted with an undead
zombie clone that doesn't go away.

This commit makes sure said clones get reaped with their
actors.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1166
---
 js/ui/windowManager.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index b439b3c0a..3fda973f1 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1318,8 +1318,13 @@ var WindowManager = new Lang.Class({
         if (this._clearAnimationInfo(actor))
             this._shellwm.completed_size_change(actor);
 
+        let destroyId = actor.connect('destroy', () => {
+            this._clearAnimationInfo(actor);
+        });
+
         actor.__animationInfo = { clone: actorClone,
-                                  oldRect: oldFrameRect };
+                                  oldRect: oldFrameRect,
+                                  destroyId: destroyId };
     },
 
     _sizeChangedWindow(shellwm, actor) {
@@ -1380,6 +1385,7 @@ var WindowManager = new Lang.Class({
     _clearAnimationInfo(actor) {
         if (actor.__animationInfo) {
             actor.__animationInfo.clone.destroy();
+            actor.disconnect(actor.__animationInfo.destroyId);
             delete actor.__animationInfo;
             return true;
         }
-- 
2.23.0