From e2153bece1074b5d9def6f6f9c92f6fa37a41496 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Fri, 21 Jan 2022 20:54:53 +0100 Subject: [PATCH] :beetle: Fix error message --- extension.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/extension.js b/extension.js index 4396104..7d426b2 100644 --- a/extension.js +++ b/extension.js @@ -98,10 +98,18 @@ class Extension { // When the user clicks the X in the overview, the window is not deleted // immediately. However, as soon as the window is really deleted, we need to // adjust the transition of its clone. - this.metaWindow.connect('unmanaged', () => { - const transitionConfig = extensionThis._effect.getCloseTransition( - this.window_container, extensionThis._settings); - extensionThis._tweakTransitions(this.window_container, transitionConfig); + const connectionID = this.metaWindow.connect('unmanaged', () => { + if (this.window_container) { + const transitionConfig = extensionThis._effect.getCloseTransition( + this.window_container, extensionThis._settings); + extensionThis._tweakTransitions(this.window_container, transitionConfig); + } + }); + + // Make sure to not call the callback above if the Meta.Window was not unmanaged + // before leaving the overview. + this.connect('destroy', () => { + this.metaWindow.disconnect(connectionID); }); // Call the original method.