Index: configure.in
===================================================================
RCS file: /cvs/gnome/eog/configure.in,v
retrieving revision 1.230
diff -u -p -r1.230 configure.in
--- configure.in	14 Jul 2005 20:30:29 -0000	1.230
+++ configure.in	25 Jul 2005 14:19:37 -0000
@@ -22,6 +22,7 @@ LIBGNOMECANVAS_REQUIRED=2.5.92
 GCONF_REQUIRED=2.5.90
 LIBART_REQUIRED=2.3.16
 GTK_REQUIRED=2.6.0
+GNOME_DESKTOP_REQUIRED=2.9.91
 
 dnl ===============================================================================
 
@@ -51,7 +52,7 @@ AC_SUBST(LDFLAGS)
 
 dnl ================= gnome libs check ====================================
 
-EOG_MODULES="gtk+-2.0 >= $GTK_REQUIRED gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED libart-2.0 >= $LIBART_REQUIRED libgnomeprintui-2.2 libgnomeprint-2.2"
+EOG_MODULES="gtk+-2.0 >= $GTK_REQUIRED gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED   gnome-desktop-2.0 >= $GNOME_DESKTOP_REQUIRED gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED libart-2.0 >= $LIBART_REQUIRED libgnomeprintui-2.2 libgnomeprint-2.2"
 
 dnl ============== optional exif support ====================
 
Index: eog-window.c
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-window.c,v
retrieving revision 1.148
diff -u -p -r1.148 eog-window.c
--- eog-window.c	15 Jul 2005 11:34:08 -0000	1.148
+++ eog-window.c	25 Jul 2005 14:21:25 -0000
@@ -20,6 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <libgnome/gnome-desktop-item.h>
 #include <config.h>
 #include <sys/types.h>
 #include <dirent.h>
@@ -177,6 +178,7 @@ static void adapt_window_size (EogWindow
 #endif
 static void update_status_bar (EogWindow *window);
 static void job_default_progress (EogJob *job, gpointer data, float progress);
+gboolean eog_file_launch_desktop_file (const char *filename, guint32 user_time);
 
 
 static GtkWindowClass *parent_class;
@@ -585,6 +587,112 @@ verb_HelpContent_cb (GtkAction *action, 
 	}
 }
 
+static int
+launch_desktop_item (const char *desktop_file,
+                     const char *parameter,
+                     guint32 user_time,
+                     GError **error)
+{
+        GnomeDesktopItem *item = NULL;
+        GList *uris = NULL;
+        char *canonical;
+        int ret = -1;
+
+        item = gnome_desktop_item_new_from_file (desktop_file, 0, NULL);
+        if (item == NULL) return FALSE;
+
+        if (parameter != NULL)
+        {
+                canonical = gnome_vfs_make_uri_canonical (parameter);
+                uris = g_list_append (uris, canonical);
+        }
+
+        gnome_desktop_item_set_launch_time (item, user_time);
+        ret = gnome_desktop_item_launch (item, uris, 0, error);
+
+        g_list_foreach (uris, (GFunc) g_free, NULL);
+        g_list_free (uris);
+        gnome_desktop_item_unref (item);
+
+        return ret;
+}
+
+gboolean
+eog_file_launch_desktop_file (const char *filename,
+                               guint32 user_time)
+{
+        GError *error = NULL;
+        const char * const *dirs;
+        char *path = NULL;
+        int i, ret = -1;
+
+        dirs = g_get_system_data_dirs ();
+        if (dirs == NULL) return FALSE;
+
+        for (i = 0; dirs[i] != NULL; i++)
+        {
+                path = g_build_filename (dirs[i], "applications", filename, NULL);
+                if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) break;
+
+                g_free (path);
+		path = NULL;
+        }
+
+        if (path != NULL)
+        {
+                ret = launch_desktop_item (path, NULL, user_time, &error);
+
+                if (ret == -1 || error != NULL)
+                {
+                        g_warning ("Cannot launch desktop item '%s': %s\n",
+                                path, error ? error->message : "(unknown error)");
+                        g_clear_error (&error);
+                }
+
+                g_free (path);
+        }
+
+        return ret >= 0;
+}
+
+static void
+verb_SetAsWallpaper_cb (GtkAction *action, gpointer data)
+{
+        EogWindowPrivate *priv;
+	EogWindow *window;
+	int n_images;
+        guint32 user_time;
+	char *filename = NULL;
+	GnomeVFSURI *img_uri;
+	GConfClient *client;
+
+        g_return_if_fail (EOG_IS_WINDOW (data));
+	window = EOG_WINDOW (data);
+
+        priv = window->priv;
+	n_images = eog_wrap_list_get_n_selected (EOG_WRAP_LIST (priv->wraplist));
+
+	if (n_images == 1) {
+		EogImage *image;
+		image = eog_wrap_list_get_first_selected_image (EOG_WRAP_LIST (priv->wraplist));
+
+        	user_time = gtk_get_current_event_time();
+
+		g_return_if_fail (EOG_IS_WINDOW (window));
+		g_return_if_fail (EOG_IS_IMAGE (image));
+
+		img_uri = eog_image_get_uri (image);
+		filename= gnome_vfs_uri_to_string(img_uri,GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD);  
+
+		client = gconf_client_get_default();
+		gconf_client_set_string (client, "/desktop/gnome/background/picture_filename",filename, NULL);
+
+    		eog_file_launch_desktop_file ("background.desktop", user_time);
+    }
+
+}
+
+
 static void
 verb_ZoomIn_cb (GtkAction *action, gpointer data)
 {
@@ -3109,6 +3217,7 @@ static const GtkActionEntry action_entri
   { "ViewZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus", NULL, G_CALLBACK (verb_ZoomOut_cb) },
   { "ViewZoomNormal", GTK_STOCK_ZOOM_100, N_("_Normal Size"), "<control>0", NULL, G_CALLBACK (verb_ZoomNormal_cb) },
   { "ViewZoomFit", GTK_STOCK_ZOOM_FIT, N_("Best _Fit"), NULL, NULL, G_CALLBACK (verb_ZoomFit_cb) },
+  { "SetAsWallpaper", NULL, N_("Set As _Wallpaper"), NULL, NULL, G_CALLBACK (verb_SetAsWallpaper_cb) },
 
   /* accelerators */
   { "ControlEqual", GTK_STOCK_ZOOM_IN, N_("_Zoom In"), "<control>equal", NULL, G_CALLBACK (verb_ZoomIn_cb) }
Index: eog-gtk-ui.xml
===================================================================
RCS file: /cvs/gnome/eog/shell/eog-gtk-ui.xml,v
retrieving revision 1.8
diff -u -p -r1.8 eog-gtk-ui.xml
--- eog-gtk-ui.xml	14 Jul 2005 20:30:30 -0000	1.8
+++ eog-gtk-ui.xml	25 Jul 2005 14:21:26 -0000
@@ -33,6 +33,8 @@
       <menuitem action="ViewZoomOut"/>
       <menuitem action="ViewZoomNormal"/>
       <menuitem action="ViewZoomFit"/>
+      <separator/>
+      <menuitem action = "SetAsWallpaper"/>
     </menu>
     <menu action="ImageMenu">
       <menuitem action="EditFlipHorizontal"/>
