[gnome-shell/wip/overview-transition: 7/11] layout: Add different groups in the LayoutManager for discrete UI components



commit 0d34235ecbe3005ec43cf8f2c2588bae45ebf6b3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 15 02:05:53 2013 -0500

    layout: Add different groups in the LayoutManager for discrete UI components
    
    This helps take cruft out of the uiGroup, and ensures that components remain
    stacked properly on top of each other. In the future, we'll use this group
    to ensure that grabs are ordered properly, as well.

 js/gdm/loginDialog.js           |    2 +-
 js/ui/appDisplay.js             |    2 +-
 js/ui/backgroundMenu.js         |    2 +-
 js/ui/layout.js                 |   12 ++++++++++++
 js/ui/messageTray.js            |    2 +-
 js/ui/modalDialog.js            |    2 +-
 js/ui/osdWindow.js              |    2 +-
 js/ui/panelMenu.js              |    2 +-
 js/ui/screenshot.js             |    8 ++++----
 js/ui/shellEntry.js             |    2 +-
 js/ui/switcherPopup.js          |    2 +-
 js/ui/workspaceSwitcherPopup.js |    2 +-
 12 files changed, 26 insertions(+), 14 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 7810b03..a9e6f2c 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -274,7 +274,7 @@ const SessionMenuButton = new Lang.Class({
         this.actor = new St.Bin({ child: this._button });
 
         this._menu = new PopupMenu.PopupMenu(this._button, 0, St.Side.TOP);
-        Main.uiGroup.add_actor(this._menu.actor);
+        Main.layoutManager.menuGroup.add_actor(this._menu.actor);
         this._menu.actor.hide();
 
         this._menu.connect('open-state-changed',
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 154ddaa..f489a47 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1465,7 +1465,7 @@ const AppIconMenu = new Lang.Class({
         }));
         source.actor.connect('destroy', Lang.bind(this, function () { this.actor.destroy(); }));
 
-        Main.uiGroup.add_actor(this.actor);
+        Main.layoutManager.menuGroup.add_actor(this.actor);
     },
 
     _redisplay: function() {
diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js
index 71251e5..6a7495b 100644
--- a/js/ui/backgroundMenu.js
+++ b/js/ui/backgroundMenu.js
@@ -22,7 +22,7 @@ const BackgroundMenu = new Lang.Class({
 
         this.actor.add_style_class_name('background-menu');
 
-        layoutManager.uiGroup.add_actor(this.actor);
+        layoutManager.menuGroup.add_actor(this.actor);
         this.actor.hide();
     }
 });
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 0609ff2..c340506 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -219,6 +219,18 @@ const LayoutManager = new Lang.Class({
         this.addChrome(this.keyboardBox);
         this._keyboardHeightNotifyId = 0;
 
+        this.menuGroup = new St.Widget();
+        this.uiGroup.add_actor(this.menuGroup);
+
+        this.osdGroup = new St.Widget();
+        this.uiGroup.add_actor(this.osdGroup);
+
+        this.switcherPopupGroup = new St.Widget();
+        this.uiGroup.add_actor(this.switcherPopupGroup);
+
+        this.dialogGroup = new St.Widget();
+        this.uiGroup.add_actor(this.dialogGroup);
+
         // A dummy actor that tracks the mouse or text cursor, based on the
         // position set in setDummyCursorPosition.
         this.dummyCursor = new St.Widget({ width: 0, height: 0 });
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 06609c5..b705426 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1609,7 +1609,7 @@ const MessageTrayMenu = new Lang.Class({
         this._accountManager.prepare_async(null, Lang.bind(this, this._onIMPresenceChanged));
 
         this.actor.hide();
-        Main.layoutManager.addChrome(this.actor);
+        Main.layoutManager.menuGroup.add_child(this.actor);
 
         this._busyItem = new PopupMenu.PopupSwitchMenuItem(_("Notifications"));
         this._busyItem.connect('toggled', Lang.bind(this, this._updatePresence));
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index 4e444f1..34a109e 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -41,7 +41,7 @@ const ModalDialog = new Lang.Class({
     _init: function(params) {
         params = Params.parse(params, { shellReactive: false,
                                         styleClass: null,
-                                        parentActor: Main.uiGroup,
+                                        parentActor: Main.layoutManager.dialogGroup,
                                         keybindingMode: Shell.KeyBindingMode.SYSTEM_MODAL,
                                         shouldFadeIn: true,
                                         destroyOnClose: true });
diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js
index 773960c..1774d64 100644
--- a/js/ui/osdWindow.js
+++ b/js/ui/osdWindow.js
@@ -109,7 +109,7 @@ const OsdWindow = new Lang.Class({
                                    Lang.bind(this, this._monitorsChanged));
         this._monitorsChanged();
 
-        Main.uiGroup.add_child(this.actor);
+        Main.layoutManager.osdGroup.add_child(this.actor);
     },
 
     setIcon: function(icon) {
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 9bb1f1b..c1bd0ea 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -130,7 +130,7 @@ const Button = new Lang.Class({
             this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
             this.menu.actor.connect('key-press-event', Lang.bind(this, this._onMenuKeyPress));
 
-            Main.uiGroup.add_actor(this.menu.actor);
+            Main.layoutManager.menuGroup.add_actor(this.menu.actor);
             this.menu.actor.hide();
         }
     },
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 432a39d..5daf667 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -146,7 +146,7 @@ const SelectArea = new Lang.Class({
                                       reactive: true,
                                       x: 0,
                                       y: 0 });
-        Main.uiGroup.add_actor(this._group);
+        Main.layoutManager.osdGroup.add_actor(this._group);
 
         this._group.connect('button-press-event',
                             Lang.bind(this, this._onButtonPress));
@@ -259,9 +259,9 @@ const Flashspot = new Lang.Class({
     Extends: Lightbox.Lightbox,
 
     _init: function(area) {
-        this.parent(Main.uiGroup, { inhibitEvents: true,
-                                    width: area.width,
-                                    height: area.height });
+        this.parent(Main.layoutManager.osdGroup, { inhibitEvents: true,
+                                                   width: area.width,
+                                                   height: area.height });
 
         this.actor.style_class = 'flashspot';
         this.actor.set_position(area.x, area.y);
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index 055e3c5..d4f43df 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -36,7 +36,7 @@ const EntryMenu = new Lang.Class({
 
         this._passwordItem = null;
 
-        Main.uiGroup.add_actor(this.actor);
+        Main.layoutManager.menuGroup.add_actor(this.actor);
         this.actor.hide();
     },
 
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index 3b1532f..a32707f 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -54,7 +54,7 @@ const SwitcherPopup = new Lang.Class({
         this.actor.connect('allocate', Lang.bind(this, this._allocate));
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
 
-        Main.uiGroup.add_actor(this.actor);
+        Main.layoutManager.switcherPopupGroup.add_child(this.actor);
 
         this._haveModal = false;
         this._modifierMask = 0;
diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js
index cf30421..298499a 100644
--- a/js/ui/workspaceSwitcherPopup.js
+++ b/js/ui/workspaceSwitcherPopup.js
@@ -25,7 +25,7 @@ const WorkspaceSwitcherPopup = new Lang.Class({
                                      width: global.screen_width,
                                      height: global.screen_height,
                                      style_class: 'workspace-switcher-group' });
-        Main.uiGroup.add_actor(this.actor);
+        Main.layoutManager.osdGroup.add_child(this.actor);
 
         this._container = new St.BoxLayout({ style_class: 'workspace-switcher-container' });
         this._list = new Shell.GenericContainer({ style_class: 'workspace-switcher' });


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