Blob Blame History Raw
From 1a36c886c716418e034f9e34249e815c46623e3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Fri, 13 Mar 2020 19:33:27 +0100
Subject: [PATCH 18/37] docking: Reset old dash changes if something changes it

This mitigate the case that was causing the default dash to show again after
some time, as in case its size or visibility is changed we set it back to
the one we expect.

LP: #1795703
---
 docking.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/docking.js b/docking.js
index 79b1543..5e3c47f 100644
--- a/docking.js
+++ b/docking.js
@@ -1569,6 +1569,7 @@ var DockManager = class DashToDock_DockManager {
         Me.imports.extension.dockManager = this;
 
         this._remoteModel = new LauncherAPI.LauncherEntryRemoteModel();
+        this._signalsHandler = new Utils.GlobalSignalsHandler();
         this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock');
         this._oldDash = Main.overview.isDummy ? null : Main.overview.dash;
 
@@ -1621,7 +1622,6 @@ var DockManager = class DashToDock_DockManager {
 
     _bindSettingsChanges() {
         // Connect relevant signals to the toggling function
-        this._signalsHandler = new Utils.GlobalSignalsHandler();
         this._signalsHandler.add([
             Meta.MonitorManager.get(),
             'monitors-changed',
@@ -1735,6 +1735,8 @@ var DockManager = class DashToDock_DockManager {
         if (Main.overview.isDummy)
             return;
 
+        this._signalsHandler.removeWithLabel('old-dash-changes');
+
         // Hide usual Dash
         this._oldDash.hide();
 
@@ -1746,6 +1748,16 @@ var DockManager = class DashToDock_DockManager {
         // 1 static workspace only)
         this._oldDash.set_width(1);
 
+        this._signalsHandler.addWithLabel('old-dash-changes', [
+            this._oldDash,
+            'notify::visible',
+            () => this._prepareMainDash()
+        ], [
+            this._oldDash,
+            'notify::width',
+            () => this._prepareMainDash()
+        ]);
+
         // Pretend I'm the dash: meant to make appgrid swarm animation come from
         // the right position of the appShowButton.
         Main.overview._overview._controls.dash = this._allDocks[0].dash;
@@ -1775,6 +1787,8 @@ var DockManager = class DashToDock_DockManager {
         if (!this._oldDash)
                 return;
 
+        this._signalsHandler.removeWithLabel('old-dash-changes');
+
         Main.overview._overview._controls.dash = this._oldDash;
 
         Main.overview.dash.show();
-- 
2.26.0