[gnome-shell/mcatanzaro/#734996: 30/30] Delay login animation until after wallpaper has loaded
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/mcatanzaro/#734996: 30/30] Delay login animation until after wallpaper has loaded
- Date: Tue, 21 Jul 2020 00:08:29 +0000 (UTC)
commit 8ecc08d323b82067110f36f4c266ceb9ace71f8a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Jul 20 19:00:32 2020 -0500
Delay login animation until after wallpaper has loaded
Currently, the login animation can occur before the user's wallpaper has
been loaded. When this happens, we wind up displaying a solid blue
background for half a second or so before the proper background is
displayed. This looks jarring and bad. It's great that we can start
GNOME quickly, but starting up before the wallpaper is ready is *too*
quickly.
I've been meaning to fix this since 2014. Better late than never! We can
just have BackgroundManager emit a loaded signal the first time it loads
its first background, and have the startup animation code wait for that
before proceeding.
https://bugzilla.gnome.org/show_bug.cgi?id=734996
js/ui/background.js | 9 +++++++++
js/ui/layout.js | 24 +++++++++++++++++-------
2 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 20f5e89126..2811da3fb0 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -765,10 +765,19 @@ var BackgroundManager = class BackgroundManager {
this._updateBackgroundActor();
});
+ let loadedSignalId = background.connect('loaded', () => {
+ background.disconnect(loadedSignalId);
+ loadedSignalId = null;
+ this.emit('loaded');
+ });
+
backgroundActor.connect('destroy', () => {
if (changeSignalId)
background.disconnect(changeSignalId);
+ if (loadedSignalId)
+ background.disconnect(loadedSignalId);
+
if (backgroundActor.loadedSignalId)
background.disconnect(backgroundActor.loadedSignalId);
});
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 55cefb2823..1dd0eba32b 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -457,7 +457,7 @@ var LayoutManager = GObject.registerClass({
}
}
- _updateBackgrounds() {
+ _updateBackgrounds(backgroundReadyCallback) {
for (let i = 0; i < this._bgManagers.length; i++)
this._bgManagers[i].destroy();
@@ -472,6 +472,13 @@ var LayoutManager = GObject.registerClass({
if (i != this.primaryIndex && this._startingUp)
bgManager.backgroundActor.hide();
+
+ if (i == this.primaryIndex && backgroundReadyCallback) {
+ let loadedSignalId = bgManager.connect('loaded', () => {
+ bgManager.disconnect(loadedSignalId);
+ backgroundReadyCallback();
+ });
+ }
}
}
@@ -527,7 +534,7 @@ var LayoutManager = GObject.registerClass({
this._updateMonitors();
this._updateBoxes();
this._updateHotCorners();
- this._updateBackgrounds();
+ this._updateBackgrounds(null);
this._updateFullscreen();
this._updateVisibility();
this._queueUpdateRegions();
@@ -645,10 +652,17 @@ var LayoutManager = GObject.registerClass({
// regions immediately so that maximized windows restore to the
// right size taking struts into account.
this._updateRegions();
+ this.emit('startup-prepared');
+ this._startupAnimation();
} else if (Main.sessionMode.isGreeter) {
this.panelBox.translation_y = -this.panelBox.height;
+ this.emit('startup-prepared');
+ this._startupAnimation();
} else {
- this._updateBackgrounds();
+ this._updateBackgrounds(() => {
+ this.emit('startup-prepared');
+ this._startupAnimation();
+ });
// We need to force an update of the regions now before we scale
// the UI group to get the correct allocation for the struts.
@@ -666,10 +680,6 @@ var LayoutManager = GObject.registerClass({
this.uiGroup.opacity = 0;
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
}
-
- this.emit('startup-prepared');
-
- this._startupAnimation();
}
_startupAnimation() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]