From f40d5848225e42aaa9c9b80a31d5ed9782338872 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 8 Aug 2002 04:26:12 +0000 Subject: [PATCH] flag that we scuppered the remote daemon. (apply_settings): resume it if 2002-08-07 Michael Meeks * gnome-settings-sound.c (stop_esd): flag that we scuppered the remote daemon. (apply_settings): resume it if we killed it, don't kill it more than once. Don't iterate over all the sounds and try to push to the server if we have sound disabled, saves a chunk of time. This fixes the 'toggle sound a lot breaks it' bug. --- gnome-settings-daemon/ChangeLog | 11 ++++++++++ gnome-settings-daemon/gnome-settings-sound.c | 21 +++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog index 525108152..74751803f 100644 --- a/gnome-settings-daemon/ChangeLog +++ b/gnome-settings-daemon/ChangeLog @@ -1,3 +1,14 @@ +2002-08-07 Michael Meeks + + * gnome-settings-sound.c (stop_esd): flag that + we scuppered the remote daemon. + (apply_settings): resume it if we killed it, + don't kill it more than once. + Don't iterate over all the sounds and try to + push to the server if we have sound disabled, + saves a chunk of time. + This fixes the 'toggle sound a lot breaks it' bug. + 2002-08-03 Jody Goldberg http://bugzilla.gnome.org/show_bug.cgi?id=88634 diff --git a/gnome-settings-daemon/gnome-settings-sound.c b/gnome-settings-daemon/gnome-settings-sound.c index a2376461f..2925ecb80 100644 --- a/gnome-settings-daemon/gnome-settings-sound.c +++ b/gnome-settings-daemon/gnome-settings-sound.c @@ -73,6 +73,8 @@ start_esd (void) } } +static gboolean set_standby = FALSE; + /* stop_esd * * Stop the Enlightenment Sound Daemon. @@ -82,6 +84,7 @@ stop_esd (void) { /* Can't think of a way to do this reliably, so we fake it for now */ esd_standby (gnome_sound_connection_get ()); + set_standby = TRUE; } /* reload_foreach_cb @@ -146,12 +149,20 @@ apply_settings (void) event_sounds = gconf_client_get_bool (client, "/desktop/gnome/sound/event_sounds", NULL); event_changed_new = gconf_client_get_int (client, "/desktop/gnome/sound/event_changed", NULL); - if (enable_esd && gnome_sound_connection_get () < 0) - start_esd (); - else if (!enable_esd) + if (enable_esd) { + if (gnome_sound_connection_get () < 0) + start_esd (); + + else if (set_standby) { + esd_resume (gnome_sound_connection_get ()); + set_standby = FALSE; + } + + } else if (!enable_esd && !set_standby) stop_esd (); - if (!inited || event_changed_old != event_changed_new) + if ((enable_esd && event_sounds) && + (!inited || event_changed_old != event_changed_new)) { SoundProperties *props; @@ -164,7 +175,7 @@ apply_settings (void) gtk_object_destroy (GTK_OBJECT (props)); } - g_object_unref (G_OBJECT (client)); + g_object_unref (client); } void