From ce2e07e5bb4e2c03e5c1fb2afb98c1c4326f7106 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Wed, 8 May 2019 08:26:18 -0400 Subject: [PATCH] Ensure dynamic transparency is instantiated on disable --- panel.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/panel.js b/panel.js index df0f57c..45d06a5 100644 --- a/panel.js +++ b/panel.js @@ -157,7 +157,7 @@ var dtpPanelWrapper = Utils.defineClass({ this.panel._leftBox.remove_child(this.appMenu.container); //the timeout makes sure the theme's styles are computed before initially applying the transparency - Mainloop.timeout_add(0, () => { + this.startDynamicTransparencyId = Mainloop.timeout_add(0, () => { this.dynamicTransparency = new Transparency.DynamicTransparency(this); }); @@ -280,7 +280,12 @@ var dtpPanelWrapper = Utils.defineClass({ this._showDesktopTimeoutId = 0; } - this.dynamicTransparency.destroy(); + if (this.startDynamicTransparencyId) { + Mainloop.source_remove(this.startDynamicTransparencyId); + this.startDynamicTransparencyId = 0; + } else { + this.dynamicTransparency.destroy(); + } // reset stored icon size to the default dash Main.overview.dashIconSize = Main.overview._controls.dash.iconSize;