Index: gnome-settings-daemon/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-control-center/gnome-settings-daemon/ChangeLog,v
retrieving revision 1.173
diff -p -u -r1.173 ChangeLog
--- gnome-settings-daemon/ChangeLog	14 Mar 2005 21:22:16 -0000	1.173
+++ gnome-settings-daemon/ChangeLog	4 May 2005 20:26:06 -0000
@@ -1,3 +1,8 @@
+2005-05-04  William Jon McCann  <mccann@jhu.edu>
+
+	* gnome-settings-multimedia-keys.c (do_screensaver_action) 
+	(do_action): 
+
 2005-03-14  Kjartan Maraas  <kmaraas@gnome.org>
 
 	* gnome-settings-accessibility-keyboard.c: (set_server_from_gconf),
Index: gnome-settings-daemon/gnome-settings-multimedia-keys.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/gnome-settings-daemon/gnome-settings-multimedia-keys.c,v
retrieving revision 1.12
diff -p -u -r1.12 gnome-settings-multimedia-keys.c
--- gnome-settings-daemon/gnome-settings-multimedia-keys.c	17 Feb 2005 18:19:06 -0000	1.12
+++ gnome-settings-daemon/gnome-settings-multimedia-keys.c	4 May 2005 20:26:06 -0000
@@ -1,4 +1,5 @@
-/* 
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ * 
  * Copyright (C) 2001,2002,2003 Bastien Nocera <hadess@hadess.net>
  *
  * gnome-settings-multimedia-keys.c
@@ -44,7 +45,7 @@
 
 #define DIALOG_TIMEOUT 1000     /* dialog timeout in ms */
 #define VOLUME_STEP 6           /* percents for one volume button press */
-                                                                                
+
 /* we exclude shift, GDK_CONTROL_MASK and GDK_MOD1_MASK since we know what
    these modifiers mean
    these are the mods whose combinations are bound by the keygrabbing code */
@@ -799,6 +800,25 @@ do_sound_action (Acme *acme, int type)
 }
 
 static void
+do_screensaver_action (Acme *acme)
+{
+	char *command;
+	char *path;
+
+	path = g_find_program_in_path ("gnome-screensaver-command");
+	if (path) {
+		command = g_strdup_printf ("%s --lock", path);
+		g_free (path);
+	} else {
+		command = g_strdup ("xscreensaver-command -lock");
+	}
+
+	execute (command, FALSE);
+
+	g_free (command);
+}
+
+static void
 do_action (Acme *acme, int type)
 {
 	switch (type) {
@@ -826,7 +846,7 @@ do_action (Acme *acme, int type)
 		do_sleep_action ("apm", "xset dpms force off");
 		break;
 	case SCREENSAVER_KEY:
-		execute ("xscreensaver-command -lock", FALSE);
+		do_screensaver_action (acme);
 		break;
 	case HELP_KEY:
 		do_help_action (acme);
Index: gnome-settings-daemon/gnome-settings-screensaver.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/gnome-settings-daemon/gnome-settings-screensaver.c,v
retrieving revision 1.2
diff -p -u -r1.2 gnome-settings-screensaver.c
--- gnome-settings-daemon/gnome-settings-screensaver.c	30 Apr 2002 09:45:05 -0000	1.2
+++ gnome-settings-daemon/gnome-settings-screensaver.c	4 May 2005 20:26:06 -0000
@@ -1,6 +1,6 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-screensaver.c
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * gnome-settings-screensaver.c
  *
  * Copyright (C) 2002 Sun Microsystems, Inc.
  *
@@ -33,7 +33,6 @@
 
 #define START_SCREENSAVER_KEY   "/apps/gnome_settings_daemon/screensaver/start_screensaver"
 #define SHOW_STARTUP_ERRORS_KEY "/apps/gnome_settings_daemon/screensaver/show_startup_errors"
-#define XSCREENSAVER_COMMAND    "xscreensaver -nosplash"
 
 void
 gnome_settings_screensaver_init (GConfClient *client)
@@ -41,12 +40,6 @@ gnome_settings_screensaver_init (GConfCl
 	/*
 	 * do nothing.
 	 *
-	 * our settings only apply to startup, and the screensaver
-	 * settings are all in xscreensaver and not gconf.
-	 *
-	 * we could have xscreensaver-demo run gconftool-2 directly,
-	 * and start / stop xscreensaver here
-	 *
 	 */
 }
 
@@ -70,13 +63,24 @@ gnome_settings_screensaver_load (GConfCl
 	gboolean start_screensaver;
 	gboolean show_error;
 	GtkWidget *dialog, *toggle;
- 
+	char *command;
+	int res;
+
 	start_screensaver = gconf_client_get_bool (client, START_SCREENSAVER_KEY, NULL);
 
 	if (!start_screensaver)
 		return;
 
-	if (g_spawn_command_line_async (XSCREENSAVER_COMMAND, &gerr))
+	command = g_find_program_in_path ("gnome-screensaver");
+	if (!command) {
+		command = g_strdup ("xscreensaver -nosplash");
+	}
+
+	res = g_spawn_command_line_async (command, &gerr);
+
+	g_free (command);
+
+	if (res)
 		return;
 	
 	show_error = gconf_client_get_bool (client, SHOW_STARTUP_ERRORS_KEY, NULL);
