[gnome-shell] layout: Rebuild struts and the input region when the Shell starts up



commit 5d3c90197ce71d1f1fca528cfc99a1d3c48df58f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 19 23:21:35 2013 -0500

    layout: Rebuild struts and the input region when the Shell starts up
    
    This means that windows will be positioned correctly with respect
    to the panel when the shell starts up, and there won't be adjusting
    after the session animation zooms in entirely.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694227

 js/ui/layout.js |   12 ++++++++++--
 js/ui/main.js   |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 81909f1..994d79c 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -221,7 +221,6 @@ const LayoutManager = new Lang.Class({
         global.screen.connect('monitors-changed',
                               Lang.bind(this, this._monitorsChanged));
         this._monitorsChanged();
-        this._prepareStartupAnimation();
     },
 
     // This is called by Main after everything else is constructed;
@@ -537,7 +536,7 @@ const LayoutManager = new Lang.Class({
     // MetaBackgroundActor inside global.window_group covers the entirety of the
     // screen. So, we set no_clear_hint at the end of the animation.
 
-    _prepareStartupAnimation: function() {
+    prepareStartupAnimation: function() {
         // Set ourselves to FULLSCREEN input mode while the animation is running
         // so events don't get delivered to X11 windows (which are distorted by the animation)
         global.stage_input_mode = Shell.StageInputMode.FULLSCREEN;
@@ -556,6 +555,10 @@ const LayoutManager = new Lang.Class({
         if (Main.sessionMode.isGreeter) {
             this.panelBox.translation_y = -this.panelBox.height;
         } else {
+            // We need to force an update of the regions now before we scale
+            // the UI group to get the coorect allocation for the struts.
+            this._updateRegions();
+
             this.trayBox.hide();
             this.keyboardBox.hide();
 
@@ -613,6 +616,8 @@ const LayoutManager = new Lang.Class({
             this._createSecondaryBackgrounds();
 
         this.emit('panel-box-changed');
+
+        this._queueUpdateRegions();
     },
 
     showKeyboard: function () {
@@ -829,6 +834,9 @@ const LayoutManager = new Lang.Class({
         if (Main.sessionMode.isGreeter)
             return;
 
+        if (this._startingUp)
+            return;
+
         if (!this._updateRegionIdle)
             this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this._updateRegions),
                                                        Meta.PRIORITY_BEFORE_REDRAW);
diff --git a/js/ui/main.js b/js/ui/main.js
index fa42f25..ee44dcf 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -152,6 +152,7 @@ function startSession() {
     componentManager = new Components.ComponentManager();
 
     layoutManager.init();
+    layoutManager.prepareStartupAnimation();
     overview.init();
 
     global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,


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