File gnome-settings-daemon-bnc527361-use-pulse.patch of Package gnome-settings-daemon

Index: gnome-settings-daemon-2.24.0/configure.ac
===================================================================
--- gnome-settings-daemon-2.24.0.orig/configure.ac
+++ gnome-settings-daemon-2.24.0/configure.ac
@@ -226,142 +226,32 @@ AC_SUBST(GIOUNIX_CFLAGS)
 AC_SUBST(GIOUNIX_LIBS)
 
 dnl ==============================================
-dnl Esd section
+dnl PulseAudio section
 dnl ==============================================
 
-AC_ARG_ENABLE(esd,
-  AC_HELP_STRING([--disable-esd],
-                 [turn off ESD audio support]),
+
+have_pulse=false
+AC_ARG_ENABLE(pulse,
+  AC_HELP_STRING([--disable-pulse],
+                 [turn off PulseAudio support]),
        [case "${enableval}" in
-               yes) WANT_ESD=yes ;;
-               no)  WANT_ESD=no ;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --disable-esd) ;;
+               yes) WANT_PULSE=yes ;;
+               no)  WANT_PULSE=no ;;
+               *) AC_MSG_ERROR(bad value ${enableval} for --disable-pulse) ;;
        esac],
-       [WANT_ESD=yes]) dnl Default value
-
-if test x$WANT_ESD = xyes ; then
-       PKG_CHECK_MODULES(ESD, esound >= 0.2.28,
-	       AC_DEFINE(HAVE_ESD, 1, [Define if ESD sound server should be used]),
-               AC_MSG_RESULT([disabled]))
-
-       GSD_ESD_LOCATION=`pkg-config esound --variable=esd_serverdir`
-       if test "x$GSD_ESD_LOCATION" != "x"; then
-           # Add slash so that if the ESD pkgconfig file does not
-           # specify esd_serverdir, g-s-d will look in the PATH
-           GSD_ESD_LOCATION="$GSD_ESD_LOCATION/"
-       fi
-fi
-
-AC_SUBST(ESD_CFLAGS)
-AC_SUBST(ESD_LIBS)
-AC_SUBST(ESD_LOCATION)
-
-dnl ==============================================
-dnl GStreamer section
-dnl ==============================================
-GST_MAJORMINOR=auto
-
-AC_ARG_ENABLE(gstreamer,
-AC_HELP_STRING([--enable-gstreamer],[use gstreamer if available (and optionally specify a version)]),
-[case "${enableval}" in
- yes) ENABLE_GSTREAMER=yes ;;
- 0.10) ENABLE_GSTREAMER=yes && GST_MAJORMINOR=0.10 ;;
- no)  ENABLE_GSTREAMER=no ;;
- *) AC_MSG_ERROR([
-                  *** Bad value ${enableval} for --enable-gstreamer
-                  *** Please use one of the following:
-                  ***    --enable-gstreamer=0.10
-               ]) ;;
-esac],
-[ENABLE_GSTREAMER=yes]) dnl Default value
-
-have_gstreamer=no
-if test "x$ENABLE_GSTREAMER" = "xyes"; then
-   GST_REQS=0.10.1.2
-   PKGS="gstreamer-0.10 >= $GST_REQS gstreamer-plugins-base-0.10 >= $GST_REQS"
-
-   PKG_CHECK_MODULES(GST, $PKGS, have_gstreamer=yes,
-                     AC_MSG_RESULT([no]))
-
-   if test "x$have_gstreamer" = "xyes"; then
-      GST_LIBS="$GST_LIBS -lgstinterfaces-0.10 -lgstaudio-0.10"
-   fi
-else
-   AC_MSG_NOTICE([*** GStreamer support disabled ***])
-fi
-AM_CONDITIONAL(HAVE_GSTREAMER, test "x$have_gstreamer" = "xyes")
-AC_SUBST(GST_LIBS)
-AC_SUBST(GST_CFLAGS)
-
-dnl ==============================================
-dnl OSS section
-dnl ==============================================
+       [WANT_PULSE=yes]) dnl Default value
 
-have_oss=no
-if test "x$have_gstreamer" != "xyes"; then
-  AC_TRY_COMPILE([
-		  #ifdef __NetBSD__
-		  #include <sys/param.h>
-		  #include <sys/sysctl.h>
-		  #include <soundcard.h>
-		  #else
-		  #include <sys/soundcard.h>
-		  #endif
-		  ],[
-		     int arg = SNDCTL_DSP_SETFRAGMENT;
-		     ],[
-			have_oss=yes
-			])
-  AC_MSG_CHECKING(for OSS audio support)
-  AC_MSG_RESULT($have_oss)
+if test x$WANT_PULSE = xyes ; then
+       PA_REQUIRED_VERSION=0.9.15
+       PKG_CHECK_MODULES(PULSE, glib-2.0 libpulse >= $PA_REQUIRED_VERSION libpulse-mainloop-glib >= $PA_REQUIRED_VERSION,
+             [have_pulse=true
+              AC_DEFINE(HAVE_PULSE, 1, [Define if PULSE sound server should be used])],
+             [have_pulse=false])
 fi
+AM_CONDITIONAL(HAVE_PULSE, test "x$have_pulse" = "xtrue")
 
-AM_CONDITIONAL(HAVE_OSS, test x"$have_oss" = "xyes")
-
-dnl ==============================================
-dnl ALSA section
-dnl ==============================================
-
-have_alsa=no
-if test "x$have_gstreamer" != "xyes"; then
-  AC_ARG_ENABLE(alsa,
-		AC_HELP_STRING([--disable-alsa],
-			       [turn off ALSA audio support]),
-			       [case "${enableval}" in
-				yes) WANT_ALSA=yes ;;
-				no)  WANT_ALSA=no ;;
-				*) AC_MSG_ERROR(bad value ${enableval} for --disable-alsa) ;;
-			esac],
-			[WANT_ALSA=yes]) dnl Default value
-
-  if test x$WANT_ALSA = xyes ; then
-	  PKG_CHECK_MODULES(ALSA, alsa >= 0.9.0,
-			    have_alsa=yes,
-			    AC_MSG_RESULT([disabled]))
-  fi
-
-  AC_SUBST(ALSA_LIBS)
-  AC_SUBST(ALSA_CFLAGS)
-fi
-
-AM_CONDITIONAL(HAVE_ALSA, test x"$have_alsa" = "xyes")
-
-# ---------------------------------------------------------------------------
-# Enable Legacy Sound Preference
-# ---------------------------------------------------------------------------
-PKG_CHECK_MODULES(PULSEAUDIO, libpulse, have_pulseaudio=yes, have_pulseaudio=no)
-if test x$have_pulseaudio = xyes; then
-	default_enable_legacy_sound_pref=no
-else
-	default_enable_legacy_sound_pref=yes
-fi
-AC_ARG_ENABLE(legacy-sound-pref,
-	[AC_HELP_STRING([--enable-legacy-sound-pref],
-	[check for preference to start ESD])],
-	,enable_legacy_sound_pref=$default_enable_legacy_sound_pref)
-if test "x$enable_legacy_sound_pref" = "xyes"; then
-    AC_DEFINE(ENABLE_LEGACY_SOUND_PREF,1,[enable preference for ESD startup])
-fi
+AC_SUBST(PULSE_CFLAGS)
+AC_SUBST(PULSE_LIBS)
 
 # ---------------------------------------------------------------------------
 # Enable Profiling
@@ -461,7 +351,7 @@ plugins/housekeeping/Makefile
 plugins/keybindings/Makefile
 plugins/keyboard/Makefile
 plugins/media-keys/Makefile
-plugins/media-keys/actions/Makefile
+plugins/media-keys/cut-n-paste/Makefile
 plugins/media-keys/libhal-glib/Makefile
 plugins/mouse/Makefile
 plugins/proxy/Makefile
@@ -505,10 +395,7 @@ echo "
 
         dbus-1 system.d dir:      ${DBUS_SYS_DIR}
 
-        OSS support:              ${have_oss}
-        ALSA support:             ${have_alsa}
-        GStreamer support:        ${have_gstreamer}
-        ESD support:              ${WANT_ESD}
+        PulseAudio support:       ${have_pulse}
 
         Profiling support:        ${enable_profiling}
 "
Index: gnome-settings-daemon-2.24.0/plugins/media-keys/Makefile.am
===================================================================
--- gnome-settings-daemon-2.24.0.orig/plugins/media-keys/Makefile.am
+++ gnome-settings-daemon-2.24.0/plugins/media-keys/Makefile.am
@@ -1,12 +1,12 @@
 NULL =
 
-SUBDIRS = 		\
-	actions		\
-	libhal-glib	\
-	$(NULL)
+SUBDIRS = libhal-glib
+plugin_LTLIBRARIES =
 
-plugin_LTLIBRARIES = \
-	libmedia-keys.la
+if HAVE_PULSE
+SUBDIRS += cut-n-paste
+plugin_LTLIBRARIES += libmedia-keys.la
+endif
 
 BUILT_SOURCES = 			\
 	gsd-media-keys-manager-glue.h	\
@@ -32,16 +32,17 @@ libmedia_keys_la_SOURCES = 		\
 	gsd-media-keys-manager.c	\
 	gsd-media-keys-window.h		\
 	gsd-media-keys-window.c		\
+	acme.h				\
 	$(BUILT_SOURCES)		\
 	$(NULL)
 
 libmedia_keys_la_CPPFLAGS = \
 	-I$(top_srcdir)/gnome-settings-daemon			\
 	-I$(top_srcdir)/plugins/common				\
-	-I$(top_builddir)/plugins/media-keys/actions		\
+	-I$(top_srcdir)/plugins/media-keys/cut-n-paste		\
 	-I$(top_builddir)/plugins/media-keys/libhal-glib	\
 	-DPIXMAPDIR=\""$(pkgdatadir)"\"				\
-	-DGLADEDIR=\""$(pkgdatadir)"\"				\
+	-DGTKBUILDERDIR=\""$(pkgdatadir)"\"			\
 	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"	\
 	$(AM_CPPFLAGS)
 
@@ -53,17 +54,18 @@ libmedia_keys_la_LDFLAGS = 		\
 	$(GSD_PLUGIN_LDFLAGS)
 
 libmedia_keys_la_LIBADD  = 		\
-	$(top_builddir)/plugins/common/libcommon.la		\
-	$(top_builddir)/plugins/media-keys/actions/libacme.la	\
+	$(top_builddir)/plugins/common/libcommon.la			\
+	$(top_builddir)/plugins/media-keys/cut-n-paste/libgvc.la	\
 	$(top_builddir)/plugins/media-keys/libhal-glib/libhal-glib.la \
-	$(SETTINGS_PLUGIN_LIBS)		\
-	$(XF86MISC_LIBS)		\
-	$(GST_LIBS)
+	$(SETTINGS_PLUGIN_LIBS)						\
+	$(XF86MISC_LIBS)
 
 plugin_in_files = 		\
 	media-keys.gnome-settings-plugin.in
 
+if HAVE_PULSE
 plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
+endif
 
 noinst_PROGRAMS =				\
 	test-media-keys				\
@@ -78,10 +80,10 @@ test_media_window_SOURCES =			\
 
 test_media_window_CPPFLAGS = \
 	-I$(top_srcdir)/gnome-settings-daemon			\
-	-I$(top_builddir)/plugins/media-keys/actions		\
+	-I$(top_srcdir)/plugins/media-keys/cut-n-paste		\
 	-I$(top_builddir)/plugins/media-keys/libhal-glib	\
 	-DPIXMAPDIR=\""$(pkgdatadir)"\"				\
-	-DGLADEDIR=\""$(pkgdatadir)"\"				\
+	-DGTKBUILDERDIR=\""$(pkgdatadir)"\"			\
 	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"	\
 	$(AM_CPPFLAGS)
 
@@ -107,10 +109,10 @@ test_media_keys_SOURCES =			\
 test_media_keys_CPPFLAGS = \
 	-I$(top_srcdir)/gnome-settings-daemon			\
 	-I$(top_srcdir)/plugins/common				\
-	-I$(top_builddir)/plugins/media-keys/actions		\
+	-I$(top_srcdir)/plugins/media-keys/cut-n-paste		\
 	-I$(top_builddir)/plugins/media-keys/libhal-glib	\
 	-DPIXMAPDIR=\""$(pkgdatadir)"\"				\
-	-DGLADEDIR=\""$(pkgdatadir)"\"				\
+	-DGTKBUILDERDIR=\""$(pkgdatadir)"\"			\
 	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"	\
 	$(AM_CPPFLAGS)
 
@@ -119,19 +121,36 @@ test_media_keys_CFLAGS = \
 	$(AM_CFLAGS)
 
 test_media_keys_LDADD = \
-	$(top_builddir)/gnome-settings-daemon/libgsd-profile.la	\
-	$(top_builddir)/plugins/common/libcommon.la		\
-	$(top_builddir)/plugins/media-keys/actions/libacme.la	\
+	$(top_builddir)/gnome-settings-daemon/libgsd-profile.la		\
+	$(top_builddir)/plugins/common/libcommon.la			\
 	$(top_builddir)/plugins/media-keys/libhal-glib/libhal-glib.la \
 	$(SETTINGS_DAEMON_LIBS)			\
 	$(SETTINGS_PLUGIN_LIBS)			\
 	$(XF86MISC_LIBS)			\
 	$(GST_LIBS)
 
+if HAVE_PULSE
+test_media_keys_LDADD += $(top_builddir)/plugins/media-keys/cut-n-paste/libgvc.la
+endif
+
+gtkbuilderdir = $(pkgdatadir)
+gtkbuilder_DATA =	\
+	acme.ui		\
+	$(NULL)
+
+pixmapsdir = $(pkgdatadir)
+pixmaps_DATA = 		\
+	acme-eject.png	\
+	$(NULL)
+
+DIST_SUBDIRS = cut-n-paste
+
 EXTRA_DIST = 				\
 	gsd-media-keys-manager.xml	\
 	gsd-marshal.list		\
-	$(plugin_in_files)
+	$(plugin_in_files)		\
+	$(gtkbuilder_DATA)		\
+	$(pixmaps_DATA)
 
 CLEANFILES = 			\
 	$(BUILT_SOURCES)	\
Index: gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-manager.c
===================================================================
--- gnome-settings-daemon-2.24.0.orig/plugins/media-keys/gsd-media-keys-manager.c
+++ gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-manager.c
@@ -56,16 +56,20 @@
 #include "gsd-media-keys-manager-glue.h"
 
 #include "eggaccelerators.h"
-#include "actions/acme.h"
-#include "actions/acme-volume.h"
+#include "acme.h"
 #include "gsd-media-keys-window.h"
 
+#ifdef HAVE_PULSE
+#include "gvc-mixer-control.h"
+#endif /* HAVE_PULSE */
+
 #define GSD_DBUS_PATH "/org/gnome/SettingsDaemon"
 #define GSD_DBUS_NAME "org.gnome.SettingsDaemon"
 #define GSD_MEDIA_KEYS_DBUS_PATH GSD_DBUS_PATH "/MediaKeys"
 #define GSD_MEDIA_KEYS_DBUS_NAME GSD_DBUS_NAME ".MediaKeys"
 
 #define VOLUME_STEP 6           /* percents for one volume button press */
+#define MAX_VOLUME 65536.0
 
 #define GSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MEDIA_KEYS_MANAGER, GsdMediaKeysManagerPrivate))
 
@@ -76,7 +80,11 @@ typedef struct {
 
 struct GsdMediaKeysManagerPrivate
 {
-        AcmeVolume      *volume;
+#ifdef HAVE_PULSE
+        /* Volume bits */
+        GvcMixerControl *volume;
+        GvcMixerStream  *stream;
+#endif /* HAVE_PULSE */
         GtkWidget       *dialog;
         GConfClient     *conf_client;
         HalDevice 	*hk_device;
@@ -630,19 +638,19 @@ do_eject_action (GsdMediaKeysManager *ma
         g_free (command);
 }
 
+#ifdef HAVE_PULSE
 static void
 do_sound_action (GsdMediaKeysManager *manager,
                  int                  type)
 {
         gboolean muted;
         gboolean toggle_mute;
-        int      vol;
-        int      vol_step;
+        guint vol, norm_vol_step;
+        int vol_step;
         GError  *error = NULL;
 
-        if (manager->priv->volume == NULL) {
+        if (manager->priv->stream == NULL)
                 return;
-        }
 
         vol_step = gconf_client_get_int (manager->priv->conf_client,
                                          GCONF_MISC_DIR "/volume_step",
@@ -653,6 +661,7 @@ do_sound_action (GsdMediaKeysManager *ma
                 g_error_free (error);
         }
 
+        norm_vol_step = PA_VOLUME_NORM * vol_step / 100;
         toggle_mute = gconf_client_get_bool (manager->priv->conf_client,
                                              GCONF_MISC_DIR "/toggle_mute",
                                              &error);
@@ -662,51 +671,65 @@ do_sound_action (GsdMediaKeysManager *ma
                 g_error_free (error);
         }
 
-        if (vol_step > 0) {
-                int threshold = acme_volume_get_threshold (manager->priv->volume);
-                if (vol_step < threshold)
-                        vol_step = threshold;
-        }
 
         /* FIXME: this is racy */
-        vol = acme_volume_get_volume (manager->priv->volume);
-        muted = acme_volume_get_mute (manager->priv->volume);
+        vol = gvc_mixer_stream_get_volume (manager->priv->stream);
+        muted = gvc_mixer_stream_get_is_muted (manager->priv->stream);
 
         switch (type) {
         case MUTE_KEY:
+                muted = !muted;
                 if (toggle_mute)
-                        acme_volume_mute_toggle (manager->priv->volume);
+                        gvc_mixer_stream_change_is_muted (manager->priv->stream,
+                                                          muted);
                 else
-                        acme_volume_set_mute (manager->priv->volume, TRUE);
+                        gvc_mixer_stream_change_is_muted (manager->priv->stream,
+                                                          TRUE);
                 break;
         case VOLUME_DOWN_KEY:
-                if (!muted && (vol <= vol_step)) {
-                        acme_volume_mute_toggle (manager->priv->volume);
+                if (!muted && (vol <= norm_vol_step)) {
+                        muted = !muted;
+                        vol = 0;
+                        gvc_mixer_stream_change_is_muted (manager->priv->stream, muted);
+                        if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
+                                gvc_mixer_stream_push_volume (manager->priv->stream);
+                } else if (!muted) {
+                        vol = vol - norm_vol_step;
+                        if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
+                                gvc_mixer_stream_push_volume (manager->priv->stream);
                 }
-                acme_volume_set_volume (manager->priv->volume, vol - vol_step);
                 break;
         case VOLUME_UP_KEY:
                 if (muted) {
+                        muted = !muted;
                         if (vol == 0) {
-                                acme_volume_set_volume (manager->priv->volume, vol + vol_step);
+                               vol = vol + norm_vol_step;
+                               gvc_mixer_stream_change_is_muted (manager->priv->stream, muted);
+                               if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
+                                        gvc_mixer_stream_push_volume (manager->priv->stream);
+                        } else {
+                                gvc_mixer_stream_change_is_muted (manager->priv->stream, muted);
                         }
-                        acme_volume_mute_toggle (manager->priv->volume);
                 } else {
-                        acme_volume_set_volume (manager->priv->volume, vol + vol_step);
+                        if (vol < MAX_VOLUME) {
+                                gboolean set;
+                                if (vol + norm_vol_step >= MAX_VOLUME) {
+                                        vol = MAX_VOLUME;
+                                } else {
+                                        vol = vol + norm_vol_step;
+                                }
+                                if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE)
+                                        gvc_mixer_stream_push_volume (manager->priv->stream);
+                        }
                 }
                 break;
         }
 
-        muted = acme_volume_get_mute (manager->priv->volume);
-        vol = acme_volume_get_volume (manager->priv->volume);
-
-        /* FIXME: AcmeVolume should probably emit signals
-           instead of doing it like this */
         dialog_init (manager);
         gsd_media_keys_window_set_volume_muted (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
                                                 muted);
         gsd_media_keys_window_set_volume_level (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
-                                                vol);
+                                                (int) (100 * (double)vol / PA_VOLUME_NORM));
         gsd_media_keys_window_set_volume_step (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
                                                 vol_step);
         gsd_media_keys_window_set_is_mute_key (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
@@ -717,6 +740,44 @@ do_sound_action (GsdMediaKeysManager *ma
 }
 
 static void
+update_default_sink (GsdMediaKeysManager *manager)
+{
+        GvcMixerStream *stream;
+
+        stream = gvc_mixer_control_get_default_sink (manager->priv->volume);
+        if (stream == manager->priv->stream)
+                return;
+
+        if (manager->priv->stream != NULL) {
+                g_object_unref (manager->priv->stream);
+                manager->priv->stream = NULL;
+        }
+
+        if (stream != NULL) {
+                manager->priv->stream = g_object_ref (stream);
+        } else {
+                g_warning ("Unable to get default sink");
+        }
+}
+
+static void
+on_control_ready (GvcMixerControl     *control,
+                  GsdMediaKeysManager *manager)
+{
+        update_default_sink (manager);
+}
+
+static void
+on_control_default_sink_changed (GvcMixerControl     *control,
+                                 guint                id,
+                                 GsdMediaKeysManager *manager)
+{
+        update_default_sink (manager);
+}
+
+#endif /* HAVE_PULSE */
+
+static void
 do_sleep_action (GsdMediaKeysManager *manager,
                  char *cmd1,
                  char *cmd2)
@@ -1292,7 +1353,9 @@ do_action (GsdMediaKeysManager *manager,
         case MUTE_KEY:
         case VOLUME_DOWN_KEY:
         case VOLUME_UP_KEY:
+#ifdef HAVE_PULSE
                 do_sound_action (manager, type);
+#endif /* HAVE_PULSE */
                 break;
         case POWER_KEY:
                 do_exit_action (manager);
@@ -1537,10 +1600,30 @@ gsd_media_keys_manager_start (GsdMediaKe
                 g_error_free (gconf_error);
         }
 
-        /* initialise Volume handler */
-        gnome_settings_profile_start ("acme_volume_new");
-        manager->priv->volume = acme_volume_new ();
-        gnome_settings_profile_end ("acme_volume_new");
+#ifdef HAVE_PULSE
+        /* initialise Volume handler
+         *
+         * We do this one here to force checking gstreamer cache, etc.
+         * The rest (grabbing and setting the keys) can happen in an
+         * idle.
+         */
+        gnome_settings_profile_start ("gvc_mixer_control_new");
+
+        manager->priv->volume = gvc_mixer_control_new ("GNOME Volume Control Media Keys");
+
+        g_signal_connect (manager->priv->volume,
+                          "ready",
+                          G_CALLBACK (on_control_ready),
+                          manager);
+        g_signal_connect (manager->priv->volume,
+                          "default-sink-changed",
+                          G_CALLBACK (on_control_default_sink_changed),
+                          manager);
+
+        gvc_mixer_control_open (manager->priv->volume);
+
+        gnome_settings_profile_end ("gvc_mixer_control_new");
+#endif /* HAVE_PULSE */
 
         /* Start filtering the events */
         for (l = manager->priv->screens; l != NULL; l = l->next) {
@@ -1637,11 +1720,17 @@ gsd_media_keys_manager_stop (GsdMediaKey
 		g_free(keys[i].hk_cond_detail);
 		keys[i].hk_cond_detail = NULL;
         }
+#ifdef HAVE_PULSE
+        if (priv->stream) {
+                g_object_unref (priv->stream);
+                priv->stream = NULL;
+        }
 
         if (priv->volume) {
                 g_object_unref (priv->volume);
                 priv->volume = NULL;
         }
+#endif /* HAVE_PULSE */
 
         if (priv->dialog != NULL) {
                 gtk_widget_destroy (priv->dialog);
Index: gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-window.c
===================================================================
--- gnome-settings-daemon-2.24.0.orig/plugins/media-keys/gsd-media-keys-window.c
+++ gnome-settings-daemon-2.24.0/plugins/media-keys/gsd-media-keys-window.c
@@ -27,8 +27,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
-#include <glade/glade.h>
-
 #include "gsd-media-keys-window.h"
 
 #define DIALOG_TIMEOUT 2000     /* dialog timeout in ms */
@@ -1436,21 +1434,29 @@ gsd_media_keys_window_init (GsdMediaKeys
 
                 window->priv->fade_out_alpha = 1.0;
         } else {
-        	GladeXML *xml;
+                GtkBuilder *builder;
+                gchar *objects[] = {"acme_frame", NULL};
                 GtkWidget *frame;
 
-                xml = glade_xml_new (GLADEDIR "/acme.glade", "acme_frame", NULL);
-
-                window->priv->image = GTK_IMAGE (glade_xml_get_widget (xml, "acme_image"));
-                window->priv->progress = glade_xml_get_widget (xml, "acme_volume_progressbar");
-                frame = glade_xml_get_widget (xml, "acme_frame");
-
-                g_object_unref (xml);
+                builder = gtk_builder_new ();
+                gtk_builder_add_objects_from_file (builder,
+                                                   GTKBUILDERDIR "/acme.ui",
+                                                   objects,
+                                                   NULL);
+
+                window->priv->image = GTK_IMAGE (gtk_builder_get_object (builder, "acme_image"));
+                window->priv->progress = GTK_WIDGET (gtk_builder_get_object (builder, "acme_volume_progressbar"));
+                frame = GTK_WIDGET (gtk_builder_get_object (builder,
+                                                            "acme_frame"));
 
                 if (frame != NULL) {
                         gtk_container_add (GTK_CONTAINER (window), frame);
                         gtk_widget_show_all (frame);
                 }
+
+                /* The builder needs to stay alive until the window
+                   takes ownership of the frame (and its children)  */
+                g_object_unref (builder);
         }
 }
 
openSUSE Build Service is sponsored by