mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
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
This commit is contained in:
parent
4e0492c517
commit
5c550daecb
1 changed files with 13 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue