mirror of
https://github.com/elementary/gala.git
synced 2024-12-26 10:44:46 +03:00
Support compilation with mutter 3.15.2
This commit is contained in:
parent
91e274cf30
commit
3ab490aaf4
@ -121,7 +121,11 @@ namespace Gala
|
||||
file_watches[filename] = cache.file_changed.connect ((changed_file) => {
|
||||
if (changed_file == filename) {
|
||||
var image_cache = Meta.BackgroundImageCache.get_default ();
|
||||
#if HAS_MUTTER316
|
||||
image_cache.purge (File.new_for_path (changed_file));
|
||||
#else
|
||||
image_cache.purge (changed_file);
|
||||
#endif
|
||||
changed ();
|
||||
}
|
||||
});
|
||||
@ -146,11 +150,19 @@ namespace Gala
|
||||
set_loaded ();
|
||||
|
||||
if (files.length > 1)
|
||||
#if HAS_MUTTER316
|
||||
background.set_blend (File.new_for_path (files[0]), File.new_for_path (files[1]), animation.transition_progress, style);
|
||||
else if (files.length > 0)
|
||||
background.set_file (File.new_for_path (files[0]), style);
|
||||
else
|
||||
background.set_file (null, style);
|
||||
#else
|
||||
background.set_blend (files[0], files[1], animation.transition_progress, style);
|
||||
else if (files.length > 0)
|
||||
background.set_filename (files[0], style);
|
||||
else
|
||||
background.set_filename (null, style);
|
||||
#endif
|
||||
|
||||
queue_update_animation ();
|
||||
};
|
||||
@ -160,7 +172,11 @@ namespace Gala
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
watch_file (files[i]);
|
||||
|
||||
#if HAS_MUTTER316
|
||||
var image = cache.load (File.new_for_path (files[i]));
|
||||
#else
|
||||
var image = cache.load (files[i]);
|
||||
#endif
|
||||
|
||||
if (image.is_loaded ()) {
|
||||
num_pending_images--;
|
||||
@ -217,11 +233,19 @@ namespace Gala
|
||||
|
||||
void load_image (string filename)
|
||||
{
|
||||
#if HAS_MUTTER316
|
||||
background.set_file (File.new_for_path (filename), style);
|
||||
#else
|
||||
background.set_filename (filename, style);
|
||||
#endif
|
||||
watch_file (filename);
|
||||
|
||||
var cache = Meta.BackgroundImageCache.get_default ();
|
||||
#if HAS_MUTTER316
|
||||
var image = cache.load (File.new_for_path (filename));
|
||||
#else
|
||||
var image = cache.load (filename);
|
||||
#endif
|
||||
if (image.is_loaded ())
|
||||
set_loaded();
|
||||
else {
|
||||
|
@ -36,13 +36,21 @@ namespace Gala
|
||||
if (system_background == null) {
|
||||
system_background = new Meta.Background (meta_screen);
|
||||
system_background.set_color (DEFAULT_BACKGROUND_COLOR);
|
||||
#if HAS_MUTTER316
|
||||
system_background.set_file (File.new_for_path (DEFAULT_BACKGROUND_FILE), GDesktop.BackgroundStyle.WALLPAPER);
|
||||
#else
|
||||
system_background.set_filename (DEFAULT_BACKGROUND_FILE, GDesktop.BackgroundStyle.WALLPAPER);
|
||||
#endif
|
||||
}
|
||||
|
||||
background = system_background;
|
||||
|
||||
var cache = Meta.BackgroundImageCache.get_default ();
|
||||
#if HAS_MUTTER316
|
||||
var image = cache.load (File.new_for_path (DEFAULT_BACKGROUND_FILE));
|
||||
#else
|
||||
var image = cache.load (DEFAULT_BACKGROUND_FILE);
|
||||
#endif
|
||||
if (image.is_loaded ()) {
|
||||
image = null;
|
||||
Idle.add(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user