r13639 - in /desktop/unstable/gnome-session/debian: changelog patches/90_from_bugzilla_fix_session_sounds.patch

lool at users.alioth.debian.org lool at users.alioth.debian.org
Tue Nov 27 12:28:14 UTC 2007


Author: lool
Date: Tue Nov 27 12:28:14 2007
New Revision: 13639

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=13639
Log:
* New patch, 90_from_bugzilla_fix_session_sounds, fixes playback of session
  sounds; GNOME #466458.

Added:
    desktop/unstable/gnome-session/debian/patches/90_from_bugzilla_fix_session_sounds.patch
Modified:
    desktop/unstable/gnome-session/debian/changelog

Modified: desktop/unstable/gnome-session/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/changelog?rev=13639&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/changelog (original)
+++ desktop/unstable/gnome-session/debian/changelog Tue Nov 27 12:28:14 2007
@@ -1,4 +1,4 @@
-gnome-session (2.20.2-1) UNRELEASED; urgency=low
+gnome-session (2.20.2-1) unstable; urgency=low
 
   [ Josselin Mouette ]
   * gnome-wm:
@@ -34,8 +34,10 @@
   * New patch, 03_powermanagement, shows hibernate option in logout dialog if
     gdm supports it; will probably disappear with either the gnome-session or
     the gdm rewrite.
-
- -- Loic Minier <lool at dooz.org>  Tue, 27 Nov 2007 13:21:45 +0100
+  * New patch, 90_from_bugzilla_fix_session_sounds, fixes playback of session
+    sounds; GNOME #466458.
+
+ -- Loic Minier <lool at dooz.org>  Tue, 27 Nov 2007 13:26:26 +0100
 
 gnome-session (2.20.1-1) unstable; urgency=low
 

Added: desktop/unstable/gnome-session/debian/patches/90_from_bugzilla_fix_session_sounds.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/90_from_bugzilla_fix_session_sounds.patch?rev=13639&op=file
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/90_from_bugzilla_fix_session_sounds.patch (added)
+++ desktop/unstable/gnome-session/debian/patches/90_from_bugzilla_fix_session_sounds.patch Tue Nov 27 12:28:14 2007
@@ -1,0 +1,156 @@
+--- gnome-session-2.20.0/gnome-session/gsm-sound.c.esd	2007-09-17 20:36:00.000000000 +0200
++++ gnome-session-2.20.0/gnome-session/gsm-sound.c	2007-09-21 11:43:24.000000000 +0200
+@@ -11,6 +11,9 @@
+ 
+ #include <libgnome/gnome-sound.h>
+ #include <libgnome/gnome-triggers.h>
++#include <libgnome/gnome-util.h>
++#include <libgnome/gnome-config.h>
++#include <libgnome/gnome-exec.h>
+ 
+ #define ENABLE_SOUND_KEY        "/desktop/gnome/sound/enable_esd"
+ #define ENABLE_EVENT_SOUNDS_KEY "/desktop/gnome/sound/event_sounds"
+@@ -56,33 +59,20 @@ sound_events_enabled (void)
+ }
+ 
+ #ifdef HAVE_ESD
+-static GPid esd_pid = 0;
+-
+-static void
+-reset_esd_pid (GPid     pid,
+-	       gint     status,
+-	       gpointer ignore)
+-{
+-  if (pid == esd_pid)
+-    esd_pid = 0;
+-}
+-
+ static void
+ start_esd (void) 
+ {
+-  gchar  *argv[] = {ESD_SERVER, "-nobeeps", NULL};
++  const char args[] = ESD_SERVER " -terminate -nobeeps";
+   GError *err = NULL;
+   time_t  starttime;
+ 
+-  if (!gsm_exec_async (NULL, argv, NULL, &esd_pid, &err))
++  if (gnome_execute_shell (NULL, args) == -1)
+     {
+       g_warning ("Could not start esd: %s\n", err->message);
+       g_error_free (err);
+       return;
+     }
+ 
+-  g_child_watch_add (esd_pid, reset_esd_pid, NULL);
+-
+   starttime = time (NULL);
+   gnome_sound_init (NULL);
+ 
+@@ -94,19 +84,80 @@ start_esd (void) 
+     }
+ }
+ 
+-static void
+-stop_esd (void)
++
++static gboolean
++load_login_sample_from (const char *file,
++		gboolean   *isset)
+ {
+-  gnome_sound_shutdown ();
++	char *key;
++	char *sample_file;
++	int sample_id;
+ 
+-  if (esd_pid)
+-    {
+-      if (kill (esd_pid, SIGTERM) == -1)
+-        g_printerr ("Failed to kill esd (pid %d)\n", esd_pid);
+-      else
+-        esd_pid = 0;
+-    }
++	if (!file)
++		return FALSE;
++
++	key = g_strconcat ("=", file, "=login/file", NULL);
++	sample_file = gnome_config_get_string (key);
++	g_free (key);
++
++	if (sample_file && isset)
++		*isset = TRUE;
++	else if (isset)
++		*isset = FALSE;
++
++	if (sample_file && *sample_file && *sample_file != '/')
++	{
++		char *tmp_sample_file;
++		tmp_sample_file = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_SOUND, sample_file, TRUE, NULL);
++		g_free (sample_file);
++		sample_file = tmp_sample_file;
++	}
++
++	if (!(sample_file && *sample_file))
++	{
++		g_free (sample_file);
++		return FALSE;
++	}
++
++	sample_id = esd_sample_getid (gnome_sound_connection_get (), "gnome-2/login");
++	if (sample_id >= 0)
++		esd_sample_free (gnome_sound_connection_get (), sample_id);
++
++	sample_id = gnome_sound_sample_load ("gnome-2/login", sample_file);
++
++	if (sample_id < 0)
++	{
++		g_warning ("Couldn't load sound file %s\n", sample_file);
++		return FALSE;
++	}
++
++	g_free (sample_file);
++
++	return TRUE;
+ }
++
++#define SOUND_EVENT_FILE "sound/events/gnome-2.soundlist"
++	static gboolean
++load_login_sample (void)
++{
++	char *s;
++	gboolean loaded;
++	gboolean isset;
++
++	s = gnome_util_home_file (SOUND_EVENT_FILE);
++	loaded = load_login_sample_from (s, &isset);
++	g_free (s);
++
++	if (isset)
++		return loaded;
++
++	s = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_CONFIG, SOUND_EVENT_FILE, TRUE, NULL);
++	loaded = load_login_sample_from (s, NULL);
++	g_free (s);
++
++	return loaded;
++}
++
+ #endif /* HAVE_ESD */
+ 
+ static gboolean
+@@ -127,14 +178,14 @@ sound_init (void)
+       return FALSE;
+     }
+ 
+-  return TRUE;
++  return load_login_sample();
+ }
+ 
+ static void 
+ sound_shutdown (void)
+ {
+ #ifdef HAVE_ESD
+-  stop_esd ();
++  gnome_sound_shutdown ();
+ #endif
+ }
+ 




More information about the pkg-gnome-commits mailing list