[gnome-shell/gbsneto/remove-generic-container] buttonBox: Remove internal container



commit a65acaa9537340a6e09bf940d2442ff0ff19be1f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Aug 7 19:29:21 2018 -0300

    buttonBox: Remove internal container
    
    The internal container was added in 7c244b01c as a way
    to avoid setting custom JavaScript properties on the
    panel indicators. Turns out, we don't set any custom
    properties whatsoever, and this container in between
    the panel and when indicator is just causing unecessary
    
    The code used to hide all the indicators, then show them
    again, and was introduced by ca2e09fe8b. The reasoning
    behind this decision is not documented anywhere, even
    the bug report [1]. As far as it could be tested, this
    can be removed in favor of just not changing the visibility
    of the indicators.
    
    [1] https://bugzilla.gnome.org/show_bug.cgi?id=683156

 js/ui/panel.js     | 27 ++++++---------------------
 js/ui/panelMenu.js |  4 ----
 2 files changed, 6 insertions(+), 25 deletions(-)
---
diff --git a/js/ui/panel.js b/js/ui/panel.js
index fa5543123..69cf350bd 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -1037,7 +1037,6 @@ var Panel = new Lang.Class({
 
     _updatePanel() {
         let panel = Main.sessionMode.panel;
-        this._hideIndicators();
         this._updateBox(panel.left, this._leftBox);
         this._updateBox(panel.center, this._centerBox);
         this._updateBox(panel.right, this._rightBox);
@@ -1102,15 +1101,6 @@ var Panel = new Lang.Class({
 
     },
 
-    _hideIndicators() {
-        for (let role in PANEL_ITEM_IMPLEMENTATIONS) {
-            let indicator = this.statusArea[role];
-            if (!indicator)
-                continue;
-            indicator.container.hide();
-        }
-    },
-
     _ensureIndicator(role) {
         let indicator = this.statusArea[role];
         if (!indicator) {
@@ -1139,22 +1129,17 @@ var Panel = new Lang.Class({
     },
 
     _addToPanelBox(role, indicator, position, box) {
-        let container = indicator.container;
-        container.show();
-
-        let parent = container.get_parent();
+        let parent = indicator.get_parent();
         if (parent)
-            parent.remove_actor(container);
-
+            parent.remove_actor(indicator);
 
-        box.insert_child_at_index(container, position);
+        box.insert_child_at_index(indicator, position);
         if (indicator.menu)
             this.menuManager.addMenu(indicator.menu);
         this.statusArea[role] = indicator;
         let destroyId = indicator.connect('destroy', emitter => {
             delete this.statusArea[role];
             emitter.disconnect(destroyId);
-            container.destroy();
         });
         indicator.connect('menu-set', this._onMenuSet.bind(this));
         this._onMenuSet(indicator);
@@ -1198,11 +1183,11 @@ var Panel = new Lang.Class({
         indicator.menu._openChangedId = indicator.menu.connect('open-state-changed',
             (menu, isOpen) => {
                 let boxAlignment;
-                if (this._leftBox.contains(indicator.container))
+                if (this._leftBox.contains(indicator))
                     boxAlignment = Clutter.ActorAlign.START;
-                else if (this._centerBox.contains(indicator.container))
+                else if (this._centerBox.contains(indicator))
                     boxAlignment = Clutter.ActorAlign.CENTER;
-                else if (this._rightBox.contains(indicator.container))
+                else if (this._rightBox.contains(indicator))
                     boxAlignment = Clutter.ActorAlign.END;
 
                 if (boxAlignment == Main.messageTray.bannerAlignment)
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 402784837..995c8b89d 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -25,10 +25,6 @@ var ButtonBox = new Lang.Class({
         this.actor = this;
         this._delegate = this;
 
-        this.container = new St.Bin({ y_fill: true,
-                                      x_fill: true,
-                                      child: this.actor });
-
         this.connect('style-changed', this._onStyleChanged.bind(this));
         this._minHPadding = this._natHPadding = 0.0;
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]