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

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