[gnome-shell-extensions/wip/window-list: 2/13] Let banner notifications overlap the panel



commit 6fef2c69869c09e1c75ce86c2ebb3d96e19621a3
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Jan 15 13:52:57 2013 +0100

    Let banner notifications overlap the panel

 extensions/window-list/extension.js |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index c603628..cce2018 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -139,6 +139,7 @@ const WindowList = new Lang.Class({
     _init: function() {
         this.actor = new St.Widget({ name: 'panel',
                                      reactive: true,
+                                     track_hover: true,
                                      layout_manager: new Clutter.BinLayout()});
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
 
@@ -231,6 +232,7 @@ const WindowList = new Lang.Class({
 
 let windowList;
 let injections = {};
+let notificationParent;
 
 function init() {
 }
@@ -238,6 +240,12 @@ function init() {
 function enable() {
     windowList = new WindowList();
 
+    windowList.actor.connect('notify::hover', Lang.bind(Main.messageTray,
+        function() {
+            this._pointerInTray = windowList.actor.hover;
+            this._updateState();
+        }));
+
     injections['_trayDwellTimeout'] = MessageTray.MessageTray.prototype._trayDwellTimeout;
     MessageTray.MessageTray.prototype._trayDwellTimeout = function() {
         return false;
@@ -245,8 +253,14 @@ function enable() {
 
     injections['_tween'] = MessageTray.MessageTray.prototype._tween;
     MessageTray.MessageTray.prototype._tween = function(actor, statevar, value, params) {
-        if (statevar == '_trayState' && !Main.overview.visible) {
-            let anchorY = windowList.actor.height;
+        if (!Main.overview.visible) {
+            let anchorY;
+            if (statevar == '_trayState')
+                anchorY = windowList.actor.height;
+            else if (statevar == '_notificationState')
+                anchorY = -windowList.actor.height;
+            else
+                anchorY = 0;
             actor.anchor_y = anchorY;
         }
         injections['_tween'].call(Main.messageTray, actor, statevar, value, params);
@@ -256,15 +270,30 @@ function enable() {
         this.actor.anchor_y = 0;
         injections['_onTrayHidden'].call(Main.messageTray);
     };
+
+    notificationParent = Main.messageTray._notificationWidget.get_parent();
+    Main.messageTray._notificationWidget.hide();
+    Main.messageTray._notificationWidget.reparent(windowList.actor);
+    Main.messageTray._notificationWidget.show();
 }
 
 function disable() {
     if (!windowList)
         return;
 
+    windowList.actor.hide();
+
+    if (notificationParent) {
+        Main.messageTray._notificationWidget.reparent(notificationParent);
+        notificationParent = null;
+    }
+
     windowList.actor.destroy();
     windowList = null;
 
     for (prop in injections)
         MessageTray.MessageTray.prototype[prop] = injections[prop];
+
+    Main.messageTray._notificationWidget.set_anchor_point(0, 0);
+    Main.messageTray.actor.set_anchor_point(0, 0);
 }



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