[gnome-shell] backgroundManager: Always emit 'loaded' signal
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] backgroundManager: Always emit 'loaded' signal
- Date: Wed, 22 Jul 2020 12:24:59 +0000 (UTC)
commit 5c550daecb18fff1ef98a48374ceec71f270ce89
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Jul 22 12:32:49 2020 +0200
backgroundManager: Always emit 'loaded' signal
As backgrounds are cached, it is possible that we never emit the
'loaded' signal added in commit f386103bc1. We are relying on the
signal though, so do the same as Background and emit the signal
from an idle if the background was already loaded.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1371
js/ui/background.js | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 2811da3fb0..6ee1b31a6a 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -765,11 +765,19 @@ var BackgroundManager = class BackgroundManager {
this._updateBackgroundActor();
});
- let loadedSignalId = background.connect('loaded', () => {
- background.disconnect(loadedSignalId);
- loadedSignalId = null;
- this.emit('loaded');
- });
+ let loadedSignalId;
+ if (background.isLoaded) {
+ GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ this.emit('loaded');
+ return GLib.SOURCE_REMOVE;
+ });
+ } else {
+ loadedSignalId = background.connect('loaded', () => {
+ background.disconnect(loadedSignalId);
+ loadedSignalId = null;
+ this.emit('loaded');
+ });
+ }
backgroundActor.connect('destroy', () => {
if (changeSignalId)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]