gnome-settings-daemon r669 - in trunk: . plugins/background
- From: halfline svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r669 - in trunk: . plugins/background
- Date: Tue, 20 Jan 2009 02:52:05 +0000 (UTC)
Author: halfline
Date: Tue Jan 20 02:52:05 2009
New Revision: 669
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=669&view=rev
Log:
Add crossfade transition when switching bgs
This uses the new gnome-desktop api for doing
crossfades between backgrounds. This only
matters if nautilus isn't running, since
otherwise, it would manage the crossfade.
Modified:
trunk/ChangeLog
trunk/plugins/background/gsd-background-manager.c
Modified: trunk/plugins/background/gsd-background-manager.c
==============================================================================
--- trunk/plugins/background/gsd-background-manager.c (original)
+++ trunk/plugins/background/gsd-background-manager.c Tue Jan 20 02:52:05 2009
@@ -155,7 +155,8 @@
}
static void
-draw_background (GsdBackgroundManager *manager)
+draw_background (GsdBackgroundManager *manager,
+ gboolean use_crossfade)
{
GdkDisplay *display;
int n_screens;
@@ -185,7 +186,15 @@
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);
+ 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,14 @@
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
@@ -239,6 +255,11 @@
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);
@@ -249,7 +270,7 @@
{
manager->priv->timeout_id = 0;
setup_bg (manager);
- draw_background (manager);
+ draw_background (manager, FALSE);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]