More cleaning up

This commit is contained in:
Rico Tzschichholz 2014-10-23 10:50:24 +02:00 committed by Tom Beckmann
parent a10be988fb
commit 91e274cf30
3 changed files with 10 additions and 13 deletions

View File

@ -34,9 +34,7 @@ namespace Gala
public async void load ()
{
var file = File.new_for_path (filename);
show = new Gnome.BGSlideShow(filename);
show = new Gnome.BGSlideShow (filename);
show.load_async (null, (obj, res) => {
loaded = true;

View File

@ -42,15 +42,12 @@ namespace Gala
void update ()
{
var reference_child = get_child_at_index (0);
if (reference_child != null) {
(reference_child as Background).changed.disconnect (background_changed);
}
var reference_child = (get_child_at_index (0) as Background);
if (reference_child != null)
reference_child.changed.disconnect (background_changed);
destroy_all_children ();
var settings = BackgroundSettings.get_default ().schema;
for (var i = 0; i < screen.get_n_monitors (); i++) {
var background = new BackgroundManager (screen, i);

View File

@ -19,6 +19,9 @@ namespace Gala
{
public class SystemBackground : Meta.BackgroundActor
{
const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff };
const string DEFAULT_BACKGROUND_FILE = Config.PKGDATADIR + "/texture.png";
static Meta.Background? system_background = null;
public signal void loaded ();
@ -30,17 +33,16 @@ namespace Gala
construct
{
var filename = Config.PKGDATADIR + "/texture.png";
if (system_background == null) {
system_background = new Meta.Background (meta_screen);
system_background.set_filename (filename, GDesktop.BackgroundStyle.WALLPAPER);
system_background.set_color (DEFAULT_BACKGROUND_COLOR);
system_background.set_filename (DEFAULT_BACKGROUND_FILE, GDesktop.BackgroundStyle.WALLPAPER);
}
background = system_background;
var cache = Meta.BackgroundImageCache.get_default ();
var image = cache.load (filename);
var image = cache.load (DEFAULT_BACKGROUND_FILE);
if (image.is_loaded ()) {
image = null;
Idle.add(() => {