gnome-settings-daemon/gnome-settings-daemon-2.24.0-fade.patch

97 lines
3.9 KiB
Diff

diff -up gnome-settings-daemon-2.24.0/plugins/background/gsd-background-manager.c.fade gnome-settings-daemon-2.24.0/plugins/background/gsd-background-manager.c
--- gnome-settings-daemon-2.24.0/plugins/background/gsd-background-manager.c.fade 2008-08-04 10:25:52.000000000 -0400
+++ gnome-settings-daemon-2.24.0/plugins/background/gsd-background-manager.c 2008-10-14 15:50:08.000000000 -0400
@@ -155,7 +155,8 @@ nautilus_is_running (void)
}
static void
-draw_background (GsdBackgroundManager *manager)
+draw_background (GsdBackgroundManager *manager,
+ gboolean use_crossfade)
{
GdkDisplay *display;
int n_screens;
@@ -185,7 +186,15 @@ draw_background (GsdBackgroundManager *m
gdk_screen_get_height (screen),
TRUE);
- gnome_bg_set_pixmap_as_root (screen, pixmap);
+ if (use_crossfade) {
+ GnomeBGCrossfade *fade;
+
+ fade = gnome_bg_set_pixmap_as_root_with_crossfade (screen, pixmap, NULL);
+ g_signal_connect (fade, "finished",
+ G_CALLBACK (g_object_unref), NULL);
+ } else {
+ gnome_bg_set_pixmap_as_root (screen, pixmap);
+ }
g_object_unref (pixmap);
}
@@ -197,7 +206,7 @@ static gboolean
queue_draw_background (GsdBackgroundManager *manager)
{
manager->priv->timeout_id = 0;
- draw_background (manager);
+ draw_background (manager, TRUE);
return FALSE;
}
@@ -205,7 +214,14 @@ static void
on_bg_changed (GnomeBG *bg,
GsdBackgroundManager *manager)
{
- draw_background (manager);
+ draw_background (manager, TRUE);
+}
+
+static void
+on_bg_transitioned (GnomeBG *bg,
+ GsdBackgroundManager *manager)
+{
+ draw_background (manager, FALSE);
}
static void
@@ -252,9 +268,12 @@ gsd_background_manager_start (GsdBackgro
G_CALLBACK (on_bg_changed),
manager);
+ g_signal_connect (manager->priv->bg,
+ "transitioned",
+ G_CALLBACK (on_bg_transitioned),
+ manager);
+
watch_bg_preferences (manager);
- gnome_bg_load_from_preferences (manager->priv->bg,
- manager->priv->client);
/* If this is set, nautilus will draw the background and is
* almost definitely in our session. however, it may not be
@@ -266,14 +285,22 @@ gsd_background_manager_start (GsdBackgro
nautilus_show_desktop = gconf_client_get_bool (manager->priv->client,
"/apps/nautilus/preferences/show_desktop",
NULL);
+ if (nautilus_show_desktop) {
+
+ gnome_bg_ignore_changes (manager->priv->bg, TRUE);
+
+ gnome_bg_load_from_preferences (manager->priv->bg,
+ manager->priv->client);
+
+ gnome_bg_ignore_changes (manager->priv->bg, FALSE);
- if (!nautilus_show_desktop) {
- draw_background (manager);
- } else {
/* even when nautilus is supposedly handling the
* background, apply the settings eventually to make
* people running a nautilus-less session happy */
manager->priv->timeout_id = g_timeout_add_seconds (8, (GSourceFunc)queue_draw_background, manager);
+ } else {
+ gnome_bg_load_from_preferences (manager->priv->bg,
+ manager->priv->client);
}
gnome_settings_profile_end (NULL);