mirror of
https://github.com/elementary/gala.git
synced 2024-09-11 07:05:30 +03:00
Reload animated wallpapers when timezone changes (#1461)
This commit is contained in:
parent
0a72682e32
commit
2c6aa503b6
@ -36,6 +36,9 @@ namespace Gala {
|
||||
Cancellable cancellable;
|
||||
uint update_animation_timeout_id = 0;
|
||||
|
||||
private Gnome.WallClock clock;
|
||||
private ulong clock_timezone_handler = 0;
|
||||
|
||||
public Background (Meta.Display display, int monitor_index, string? filename,
|
||||
BackgroundSource background_source, GDesktop.BackgroundStyle style) {
|
||||
Object (display: display,
|
||||
@ -54,6 +57,13 @@ namespace Gala {
|
||||
|
||||
background_source.changed.connect (settings_changed);
|
||||
|
||||
clock = new Gnome.WallClock ();
|
||||
clock_timezone_handler = clock.notify["timezone"].connect (() => {
|
||||
if (animation != null) {
|
||||
load_animation.begin (animation.filename);
|
||||
}
|
||||
});
|
||||
|
||||
load ();
|
||||
}
|
||||
|
||||
@ -68,6 +78,10 @@ namespace Gala {
|
||||
}
|
||||
|
||||
background_source.changed.disconnect (settings_changed);
|
||||
|
||||
if (clock_timezone_handler != 0) {
|
||||
clock.disconnect (clock_timezone_handler);
|
||||
}
|
||||
}
|
||||
|
||||
public void update_resolution () {
|
||||
|
@ -32,7 +32,6 @@ namespace Gala {
|
||||
Gee.HashMap<string,BackgroundSource> background_sources;
|
||||
|
||||
Animation animation;
|
||||
string animation_filename;
|
||||
|
||||
public BackgroundCache () {
|
||||
Object ();
|
||||
@ -61,7 +60,7 @@ namespace Gala {
|
||||
}
|
||||
|
||||
public async Animation get_animation (string filename) {
|
||||
if (animation_filename == filename) {
|
||||
if (animation != null && animation.filename == filename) {
|
||||
Idle.add (() => {
|
||||
get_animation.callback ();
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user