[gnome-shell] layout: Properly order startup initialization
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] layout: Properly order startup initialization
- Date: Wed, 22 May 2013 16:53:54 +0000 (UTC)
commit 4b7e2305317deaa3695bfa10551102052a56f38a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sat May 18 19:34:35 2013 -0400
layout: Properly order startup initialization
In order to make sure that the struts and regions are initialized,
we need to make sure that we do with the conditions that nothing
is transformed, like the uiGroup, and that everything is visible.
These invariants broke during a fix to hide the UI until the
system background texture could be loaded. Now, reorder things so
that the system background is loaded, and then the UI is properly
loaded, and so on.
https://bugzilla.gnome.org/show_bug.cgi?id=696159
js/ui/layout.js | 58 +++++++++++++++++++++++++++++-------------------------
1 files changed, 31 insertions(+), 27 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 9ad33f1..68166ab 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -248,7 +248,7 @@ const LayoutManager = new Lang.Class({
init: function() {
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
- this._prepareStartupAnimation();
+ this._loadBackground();
},
showOverview: function() {
@@ -557,6 +557,25 @@ const LayoutManager = new Lang.Class({
return this._keyboardIndex;
},
+ _loadBackground: function() {
+ this._systemBackground = new Background.SystemBackground();
+ this._systemBackground.actor.hide();
+
+ global.stage.insert_child_below(this._systemBackground.actor, null);
+
+ let constraint = new Clutter.BindConstraint({ source: global.stage,
+ coordinate: Clutter.BindCoordinate.ALL });
+ this._systemBackground.actor.add_constraint(constraint);
+
+ let signalId = this._systemBackground.connect('loaded', Lang.bind(this, function() {
+ this._systemBackground.disconnect(signalId);
+ this._systemBackground.actor.show();
+ global.stage.show();
+
+ this._prepareStartupAnimation();
+ }));
+ },
+
// Startup Animations
//
// We have two different animations, depending on whether we're a greeter
@@ -602,32 +621,17 @@ const LayoutManager = new Lang.Class({
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
}
- this._systemBackground = new Background.SystemBackground();
- this._systemBackground.actor.hide();
-
- global.stage.insert_child_below(this._systemBackground.actor, null);
-
- let constraint = new Clutter.BindConstraint({ source: global.stage,
- coordinate: Clutter.BindCoordinate.ALL });
- this._systemBackground.actor.add_constraint(constraint);
-
- let signalId = this._systemBackground.connect('loaded', Lang.bind(this, function() {
- this._systemBackground.disconnect(signalId);
- this._systemBackground.actor.show();
- global.stage.show();
-
- this.emit('startup-prepared');
-
- // We're mostly prepared for the startup animation
- // now, but since a lot is going on asynchronously
- // during startup, let's defer the startup animation
- // until the event loop is uncontended and idle.
- // This helps to prevent us from running the animation
- // when the system is bogged down
- GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
- this._startupAnimation();
- return false;
- }));
+ this.emit('startup-prepared');
+
+ // We're mostly prepared for the startup animation
+ // now, but since a lot is going on asynchronously
+ // during startup, let's defer the startup animation
+ // until the event loop is uncontended and idle.
+ // This helps to prevent us from running the animation
+ // when the system is bogged down
+ GLib.idle_add(GLib.PRIORITY_LOW, Lang.bind(this, function() {
+ this._startupAnimation();
+ return false;
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]