[gnome-shell] panel: Update the hot corner when the panel box allocation changes



commit 31d14a2fb0a760785810a5c49e5a9c081814743a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Dec 3 15:56:18 2012 -0500

    panel: Update the hot corner when the panel box allocation changes
    
    This fixes the missing hotcorner in the overview.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689537

 js/ui/layout.js |    8 +++++++-
 js/ui/panel.js  |    7 +++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 3a20f92..8e59383 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -124,7 +124,7 @@ const LayoutManager = new Lang.Class({
         this.addChrome(this.panelBox, { affectsStruts: true,
                                         trackFullscreen: true });
         this.panelBox.connect('allocation-changed',
-                              Lang.bind(this, this._updatePanelBarriers));
+                              Lang.bind(this, this._panelBoxChanged));
 
         this.trayBox = new St.Widget({ name: 'trayBox',
                                        layout_manager: new Clutter.BinLayout() }); 
@@ -256,6 +256,11 @@ const LayoutManager = new Lang.Class({
                               this.bottomMonitor.width, this.bottomMonitor.height);
     },
 
+    _panelBoxChanged: function() {
+        this.emit('panel-box-changed');
+        this._updatePanelBarriers();
+    },
+
     _updatePanelBarriers: function() {
         if (this._leftPanelBarrier)
             global.destroy_pointer_barrier(this._leftPanelBarrier);
@@ -387,6 +392,7 @@ const LayoutManager = new Lang.Class({
     },
 
     _startupAnimationComplete: function() {
+        this.emit('panel-box-changed');
         this._chrome.thawUpdateRegions();
     },
 
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 7ff5284..3e7f38b 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -655,6 +655,13 @@ const ActivitiesButton = new Lang.Class({
         }));
 
         this._xdndTimeOut = 0;
+
+        // Since the hot corner uses stage coordinates, Clutter won't
+        // queue relayouts for us when the panel moves. Queue a relayout
+        // when that happens.
+        Main.layoutManager.connect('panel-box-changed', Lang.bind(this, function() {
+            container.queue_relayout();
+        }));
     },
 
     _containerGetPreferredWidth: function(actor, forHeight, alloc) {



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