Blame SOURCES/0001-dashToDock-Handle-no-overview-case.patch

629b78
From 3c62051c0a154ae987bb0126e8adb6cd86aa69a2 Mon Sep 17 00:00:00 2001
629b78
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
629b78
Date: Mon, 24 Feb 2020 16:17:05 +0100
629b78
Subject: [PATCH] dashToDock: Handle no-overview case
629b78
629b78
There is no longer an overview in GNOME Classic, so in order to be
629b78
used in that environment, the extension must deal with that case.
629b78
---
629b78
 extensions/dash-to-dock/docking.js | 122 ++++++++++++++++-------------
629b78
 1 file changed, 68 insertions(+), 54 deletions(-)
629b78
629b78
diff --git a/extensions/dash-to-dock/docking.js b/extensions/dash-to-dock/docking.js
629b78
index d35094b..2b8353a 100644
629b78
--- a/extensions/dash-to-dock/docking.js
629b78
+++ b/extensions/dash-to-dock/docking.js
629b78
@@ -233,7 +233,7 @@ var DockedDash = class DashToDock {
629b78
         // Create a new dash object
629b78
         this.dash = new MyDash.MyDash(this._settings, this._remoteModel, this._monitorIndex);
629b78
 
629b78
-        if (!this._settings.get_boolean('show-show-apps-button'))
629b78
+        if (Main.overview.isDummy || !this._settings.get_boolean('show-show-apps-button'))
629b78
             this.dash.hideShowAppsButton();
629b78
 
629b78
         // Create the main actor and the containers for sliding in and out and
629b78
@@ -272,45 +272,11 @@ var DockedDash = class DashToDock {
629b78
         this.dash.actor.add_constraint(this.constrainSize);
629b78
 
629b78
         this._signalsHandler.add([
629b78
-            Main.overview,
629b78
-            'item-drag-begin',
629b78
-            this._onDragStart.bind(this)
629b78
-        ], [
629b78
-            Main.overview,
629b78
-            'item-drag-end',
629b78
-            this._onDragEnd.bind(this)
629b78
-        ], [
629b78
-            Main.overview,
629b78
-            'item-drag-cancelled',
629b78
-            this._onDragEnd.bind(this)
629b78
-        ], [
629b78
             // update when workarea changes, for instance if  other extensions modify the struts
629b78
             //(like moving th panel at the bottom)
629b78
             global.display,
629b78
             'workareas-changed',
629b78
             this._resetPosition.bind(this)
629b78
-        ], [
629b78
-            Main.overview,
629b78
-            'showing',
629b78
-            this._onOverviewShowing.bind(this)
629b78
-        ], [
629b78
-            Main.overview,
629b78
-            'hiding',
629b78
-            this._onOverviewHiding.bind(this)
629b78
-        ], [
629b78
-            // Hide on appview
629b78
-            Main.overview.viewSelector,
629b78
-            'page-changed',
629b78
-            this._pageChanged.bind(this)
629b78
-        ], [
629b78
-            Main.overview.viewSelector,
629b78
-            'page-empty',
629b78
-            this._onPageEmpty.bind(this)
629b78
-        ], [
629b78
-            // Ensure the ShowAppsButton status is kept in sync
629b78
-            Main.overview.viewSelector._showAppsButton,
629b78
-            'notify::checked',
629b78
-            this._syncShowAppsButtonToggled.bind(this)
629b78
         ], [
629b78
             global.display,
629b78
             'in-fullscreen-changed',
629b78
@@ -325,15 +291,6 @@ var DockedDash = class DashToDock {
629b78
             this.dash,
629b78
             'icon-size-changed',
629b78
             () => { Main.overview.dashIconSize = this.dash.iconSize; }
629b78
-        ], [
629b78
-            // This duplicate the similar signal which is in owerview.js.
629b78
-            // Being connected and thus executed later this effectively
629b78
-            // overwrite any attempt to use the size of the default dash
629b78
-            //which given the customization is usually much smaller.
629b78
-            // I can't easily disconnect the original signal
629b78
-            Main.overview._controls.dash,
629b78
-            'icon-size-changed',
629b78
-            () => { Main.overview.dashIconSize = this.dash.iconSize; }
629b78
         ], [
629b78
             // sync hover after a popupmenu is closed
629b78
             this.dash,
629b78
@@ -341,6 +298,53 @@ var DockedDash = class DashToDock {
629b78
             () => { this._box.sync_hover() }
629b78
         ]);
629b78
 
629b78
+        if (!Main.overview.isDummy) {
629b78
+            this._signalsHandler.add([
629b78
+                Main.overview,
629b78
+                'item-drag-begin',
629b78
+                this._onDragStart.bind(this)
629b78
+            ], [
629b78
+                Main.overview,
629b78
+                'item-drag-end',
629b78
+                this._onDragEnd.bind(this)
629b78
+            ], [
629b78
+                Main.overview,
629b78
+                'item-drag-cancelled',
629b78
+                this._onDragEnd.bind(this)
629b78
+            ], [
629b78
+                Main.overview,
629b78
+                'showing',
629b78
+                this._onOverviewShowing.bind(this)
629b78
+            ], [
629b78
+                Main.overview,
629b78
+                'hiding',
629b78
+                this._onOverviewHiding.bind(this)
629b78
+            ], [
629b78
+                // Hide on appview
629b78
+                Main.overview.viewSelector,
629b78
+                'page-changed',
629b78
+                this._pageChanged.bind(this)
629b78
+            ], [
629b78
+                Main.overview.viewSelector,
629b78
+                'page-empty',
629b78
+                this._onPageEmpty.bind(this)
629b78
+            ], [
629b78
+                // Ensure the ShowAppsButton status is kept in sync
629b78
+                Main.overview.viewSelector._showAppsButton,
629b78
+                'notify::checked',
629b78
+                this._syncShowAppsButtonToggled.bind(this)
629b78
+            ], [
629b78
+                // This duplicate the similar signal which is in owerview.js.
629b78
+                // Being connected and thus executed later this effectively
629b78
+                // overwrite any attempt to use the size of the default dash
629b78
+                //which given the customization is usually much smaller.
629b78
+                // I can't easily disconnect the original signal
629b78
+                Main.overview._controls.dash,
629b78
+                'icon-size-changed',
629b78
+                () => { Main.overview.dashIconSize = this.dash.iconSize; }
629b78
+            ]);
629b78
+        }
629b78
+
629b78
         this._injectionsHandler = new Utils.InjectionsHandler();
629b78
         this._themeManager = new Theming.ThemeManager(this._settings, this);
629b78
 
629b78
@@ -370,14 +374,17 @@ var DockedDash = class DashToDock {
629b78
         this._dashSpacer = new OverviewControls.DashSpacer();
629b78
         this._dashSpacer.setDashActor(this._box);
629b78
 
629b78
-        if (this._position == St.Side.LEFT)
629b78
-            Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? -1 : 0); // insert on first
629b78
-        else if (this._position ==  St.Side.RIGHT)
629b78
-            Main.overview._controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? 0 : -1); // insert on last
629b78
-        else if (this._position == St.Side.TOP)
629b78
-            Main.overview._overview.insert_child_at_index(this._dashSpacer, 0);
629b78
-        else if (this._position == St.Side.BOTTOM)
629b78
-            Main.overview._overview.insert_child_at_index(this._dashSpacer, -1);
629b78
+        if (!Main.overview.isDummy) {
629b78
+            const { _controls, _overview } = Main.overview;
629b78
+            if (this._position == St.Side.LEFT)
629b78
+                _controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? -1 : 0); // insert on first
629b78
+            else if (this._position ==  St.Side.RIGHT)
629b78
+                _controls._group.insert_child_at_index(this._dashSpacer, this._rtl ? 0 : -1); // insert on last
629b78
+            else if (this._position == St.Side.TOP)
629b78
+                _overview.insert_child_at_index(this._dashSpacer, 0);
629b78
+            else if (this._position == St.Side.BOTTOM)
629b78
+                _overview.insert_child_at_index(this._dashSpacer, -1);
629b78
+        }
629b78
 
629b78
         // Add dash container actor and the container to the Chrome.
629b78
         this.actor.set_child(this._slider);
629b78
@@ -412,7 +419,7 @@ var DockedDash = class DashToDock {
629b78
 
629b78
         // Since Gnome 3.8 dragging an app without having opened the overview before cause the attemp to
629b78
         //animate a null target since some variables are not initialized when the viewSelector is created
629b78
-        if (Main.overview.viewSelector._activePage == null)
629b78
+        if (!Main.overview.isDummy && Main.overview.viewSelector._activePage == null)
629b78
             Main.overview.viewSelector._activePage = Main.overview.viewSelector._workspacesPage;
629b78
 
629b78
         this._updateVisibilityMode();
629b78
@@ -493,7 +500,8 @@ var DockedDash = class DashToDock {
629b78
             this._settings,
629b78
             'changed::show-show-apps-button',
629b78
             () => {
629b78
-                    if (this._settings.get_boolean('show-show-apps-button'))
629b78
+                    if (!Main.overview.isDummy &&
629b78
+                        this._settings.get_boolean('show-show-apps-button'))
629b78
                         this.dash.showShowAppsButton();
629b78
                     else
629b78
                         this.dash.hideShowAppsButton();
629b78
@@ -1681,6 +1689,9 @@ var DockManager = class DashToDock_DockManager {
629b78
         // set stored icon size  to the new dash
629b78
         Main.overview.dashIconSize = this._allDocks[0].dash.iconSize;
629b78
 
629b78
+        if (Main.overview.isDummy)
629b78
+            return;
629b78
+
629b78
         // Hide usual Dash
629b78
         Main.overview._controls.dash.actor.hide();
629b78
 
629b78
@@ -1707,6 +1718,9 @@ var DockManager = class DashToDock_DockManager {
629b78
     }
629b78
 
629b78
     _restoreDash() {
629b78
+        if (Main.overview.isDummy)
629b78
+            return;
629b78
+
629b78
         Main.overview._controls.dash.actor.show();
629b78
         Main.overview._controls.dash.actor.set_width(-1); //reset default dash size
629b78
         // This force the recalculation of the icon size
629b78
-- 
629b78
2.25.0
629b78