no need to spawn esd
- From: Rodrigo Moya <rodrigo gnome-db org>
- To: desktop-devel-list gnome org
- Subject: no need to spawn esd
- Date: Thu, 02 Mar 2006 12:26:09 +0100
Hi
It seems there really is no need to run esd from gnome-session and
gnome-settings-daemon, since libesound will spawn it when needed.
So, here are two patches for g-session and g-s-d that just don't spawn
it at all. It seems to work ok for me, but please could people test it
and make sure it doesn't break anything before I submit them?
--
Rodrigo Moya <rodrigo gnome-db org>
Index: gnome-settings-sound.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/gnome-settings-daemon/gnome-settings-sound.c,v
retrieving revision 1.14
diff -u -p -r1.14 gnome-settings-sound.c
--- gnome-settings-sound.c 6 Feb 2006 18:02:02 -0000 1.14
+++ gnome-settings-sound.c 2 Mar 2006 11:14:31 -0000
@@ -50,33 +50,9 @@
static void
start_esd (void)
{
- int esdpid;
- static const char *esd_cmdline[] = {ESD_SERVER, "-nobeeps", NULL};
- char *tmpargv[3];
- char argbuf[32];
- time_t starttime;
-
gnome_sound_init (NULL);
if (gnome_sound_connection_get () < 0)
- {
- GnomeClient *client = gnome_master_client ();
-
- esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
- g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
- tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
- gnome_client_set_shutdown_command (client, 2, tmpargv);
- starttime = time (NULL);
- gnome_sound_init (NULL);
-
- while (gnome_sound_connection_get () < 0
- && ((time(NULL) - starttime) < 4))
- {
-#ifdef HAVE_USLEEP
- usleep(1000);
-#endif
- gnome_sound_init(NULL);
- }
- }
+ g_warning ("Could not connect to the ESD daemon\n");
}
static gboolean set_standby = TRUE;
Index: gsm-sound.c
===================================================================
RCS file: /cvs/gnome/gnome-session/gnome-session/gsm-sound.c,v
retrieving revision 1.5
diff -u -p -r1.5 gsm-sound.c
--- gsm-sound.c 8 Oct 2002 03:01:09 -0000 1.5
+++ gsm-sound.c 2 Mar 2006 11:12:36 -0000
@@ -58,27 +58,12 @@ sound_events_enabled (void)
static void
start_esd (void)
{
- GError *err = NULL;
- time_t starttime;
-
- if (!g_spawn_command_line_async (ESD_SERVER" -nobeeps", &err))
+ gnome_sound_init (NULL);
+ if (gnome_sound_connection_get () < 0)
{
- g_warning ("Could not start esd: %s\n", err->message);
- g_error_free (err);
+ g_warning ("Could not connect to the ESD daemon\n");
return;
}
-
- starttime = time (NULL);
- gnome_sound_init (NULL);
-
- while (gnome_sound_connection_get () < 0
- && ((time(NULL) - starttime) < 4))
- {
-#ifdef HAVE_USLEEP
- usleep(200);
-#endif
- gnome_sound_init(NULL);
- }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]