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

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