layout: Move showing the stage and the startup-prepared signal

Waiting until we're idle means nothing if we're constructing
complex actors.

https://bugzilla.gnome.org/show_bug.cgi?id=694321
This commit is contained in:
Jasper St. Pierre 2013-03-06 17:55:33 -05:00
parent de2f2d7ef1
commit e2463cb501
2 changed files with 14 additions and 16 deletions

View File

@ -231,6 +231,8 @@ const LayoutManager = new Lang.Class({
Main.overview.connect('showing', Lang.bind(this, this._overviewShowing)); Main.overview.connect('showing', Lang.bind(this, this._overviewShowing));
Main.overview.connect('hidden', Lang.bind(this, this._overviewHidden)); Main.overview.connect('hidden', Lang.bind(this, this._overviewHidden));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated)); Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._prepareStartupAnimation();
}, },
_overviewShowing: function() { _overviewShowing: function() {
@ -547,7 +549,7 @@ const LayoutManager = new Lang.Class({
// MetaBackgroundActor inside global.window_group covers the entirety of the // MetaBackgroundActor inside global.window_group covers the entirety of the
// screen. So, we set no_clear_hint at the end of the animation. // 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 // 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) // so events don't get delivered to X11 windows (which are distorted by the animation)
global.stage_input_mode = Shell.StageInputMode.FULLSCREEN; global.stage_input_mode = Shell.StageInputMode.FULLSCREEN;
@ -585,25 +587,25 @@ const LayoutManager = new Lang.Class({
Lang.bind(this, function() { Lang.bind(this, function() {
this._systemBackground.disconnect(signalId); this._systemBackground.disconnect(signalId);
this._systemBackground.actor.show(); this._systemBackground.actor.show();
global.stage.show();
this.emit('startup-prepared');
// We're mostly prepared for the startup animation // We're mostly prepared for the startup animation
// now, but since a lot is going on asynchronously // now, but since a lot is going on asynchronously
// during startup, let's defer emission of the // during startup, let's defer the startup animation
// startup-prepared signal until the event loop is // until the event loop is uncontended and idle.
// uncontended and idle. This helps to prevent us // This helps to prevent us from running the animation
// from running the animation when the system is // when the system is bogged down
// bogged down
GLib.idle_add(GLib.PRIORITY_LOW, GLib.idle_add(GLib.PRIORITY_LOW,
Lang.bind(this, function() { Lang.bind(this, function() {
this.emit('startup-prepared'); this._startupAnimation();
return false; return false;
})); }));
})); }));
}, },
startupAnimation: function() { _startupAnimation: function() {
global.stage.show();
if (Main.sessionMode.isGreeter) if (Main.sessionMode.isGreeter)
this._startupAnimationGreeter(); this._startupAnimationGreeter();
else else

View File

@ -153,7 +153,6 @@ function _initializeUI() {
componentManager = new Components.ComponentManager(); componentManager = new Components.ComponentManager();
layoutManager.init(); layoutManager.init();
layoutManager.prepareStartupAnimation();
overview.init(); overview.init();
global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
@ -192,9 +191,6 @@ function _initializeUI() {
ExtensionDownloader.init(); ExtensionDownloader.init();
ExtensionSystem.init(); ExtensionSystem.init();
layoutManager.connect('startup-prepared', function() {
layoutManager.startupAnimation();
});
layoutManager.connect('startup-complete', function() { layoutManager.connect('startup-complete', function() {
if (keybindingMode == Shell.KeyBindingMode.NONE) { if (keybindingMode == Shell.KeyBindingMode.NONE) {
keybindingMode = Shell.KeyBindingMode.NORMAL; keybindingMode = Shell.KeyBindingMode.NORMAL;