[gnome-shell/wip/fmuellner/notification-redux: 83/93] layout: Simplify trayBox handling



commit b2e9ecb5e8d21ce5e5265f8fd453003f6ff74dfd
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Feb 14 14:22:57 2015 +0100

    layout: Simplify trayBox handling

 js/ui/layout.js      |   13 ++++++++-----
 js/ui/messageTray.js |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 1d839a1..ad63804 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -244,7 +244,9 @@ const LayoutManager = new Lang.Class({
 
         this.trayBox = new St.Widget({ name: 'trayBox',
                                        layout_manager: new Clutter.BinLayout() }); 
-        this.addChrome(this.trayBox);
+        this.trayBox.add_constraint(new MonitorConstraint({ primary: true,
+                                                            work_area: true }));
+        this.addChrome(this.trayBox, { affectsInputRegion: false });
 
         this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
                                                 layout_manager: new Clutter.BinLayout() });
@@ -289,6 +291,11 @@ const LayoutManager = new Lang.Class({
     init: function() {
         Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
 
+        let trayConstraint = new MonitorConstraint({ primary: true });
+        this.trayBox.add_constraint(trayConstraint);
+        this.panelBox.bind_property('visible', trayConstraint, 'work-area',
+                                    GObject.BindingFlags.SYNC_CREATE);
+
         this._loadBackground();
     },
 
@@ -458,9 +465,6 @@ const LayoutManager = new Lang.Class({
         this.panelBox.set_size(this.primaryMonitor.width, -1);
 
         this.keyboardIndex = this.primaryIndex;
-
-        this.trayBox.set_position(this.primaryMonitor.x, this.primaryMonitor.y);
-        this.trayBox.set_size(this.primaryMonitor.width, -1);
     },
 
     _panelBoxChanged: function() {
@@ -471,7 +475,6 @@ const LayoutManager = new Lang.Class({
             if (corner)
                 corner.setBarrierSize(size);
         });
-        this.trayBox.set_y(this.panelBox.y + size);
     },
 
     _updatePanelBarrier: function() {
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index fcba030..6c2dbb8 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1274,7 +1274,7 @@ const MessageTray = new Lang.Class({
 
         Main.layoutManager.trayBox.add_actor(this.actor);
         Main.layoutManager.trackChrome(this.actor);
-        Main.layoutManager.trackChrome(this._notificationBin);
+        Main.layoutManager.trackChrome(this._notificationBin, { affectsInputRegion: true });
 
         global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._updateState));
 


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