Index: plugins/xsettings/gsd-xsettings-manager.c
===================================================================
--- plugins/xsettings/gsd-xsettings-manager.c	(revision 409)
+++ plugins/xsettings/gsd-xsettings-manager.c	(working copy)
@@ -88,10 +88,17 @@ struct _TranslationEntry {
         TranslationFunc translate;
 };
 
+typedef struct _GtkModuleMapping GtkModuleMapping;
+
+struct _GtkModuleMapping {
+        const char *gconf_key;
+        const char *module_name;
+};
+
 struct GnomeXSettingsManagerPrivate
 {
         XSettingsManager **managers;
-        guint              notify[5];
+        guint              notify[6];
 #ifdef HAVE_FONTCONFIG
         fontconfig_monitor_handle_t *fontconfig_handle;
 #endif /* HAVE_FONTCONFIG */
@@ -565,6 +572,108 @@ fontconfig_callback (fontconfig_monitor_
 
 #endif /* HAVE_FONTCONFIG */
 
+static const GtkModuleMapping gtk_module_mapping [] = {
+        { SOUND_SETTINGS_DIR "/event_sounds", "canberra-gtk-module" },
+};
+
+static gchar *
+get_modules_string (const gchar *modules, const gchar *entry, gboolean enabled)
+{
+        gchar **split, *val;
+        int i;
+
+        if (modules == NULL || strcmp (modules, entry) == 0)
+                return enabled ? g_strdup (entry) : NULL;
+
+        split = g_strsplit (modules, ":", 0);
+
+        if (enabled) {
+                gboolean found = FALSE;
+
+                for (i = 0; split[i] != NULL; ++i) {
+                        if (strcmp (split[i], entry) == 0) {
+                                found = TRUE;
+                        }
+                }
+
+                if (found)
+                        val = g_strdup (modules);
+                else
+                        val = g_strconcat (modules, ":", entry, NULL);
+        } else {
+                int len, j = 0;
+                gchar **join;
+
+                len = g_strv_length (split);
+                join = g_new0 (gchar *, len + 2);
+
+                for (i = 0; split[i] != NULL; ++i) {
+                        if (strcmp (split[i], entry) != 0)
+                                join[j++] = split[i];
+                }
+                val = g_strjoinv (":", join);
+                g_free (join);
+        }
+
+        g_strfreev (split);
+
+        return val;
+}
+
+static void
+gtk_modules_callback (GConfClient           *client,
+                      guint                  cnxn_id,
+                      GConfEntry            *entry,
+                      GnomeXSettingsManager *manager)
+{
+        const GtkModuleMapping *m = NULL;
+        int i;
+        gboolean enabled;
+        gchar *cur_value, *new_value;
+
+        for (i = 0; i < G_N_ELEMENTS (gtk_module_mapping); ++i) {
+                if (strcmp (entry->key, gtk_module_mapping[i].gconf_key) == 0) {
+                        m = &gtk_module_mapping[i];
+                        break;
+                }
+        }
+
+        if (m == NULL)
+                return;
+
+        enabled = entry->value && gconf_value_get_bool (entry->value);
+        cur_value = gconf_client_get_string (client, "/desktop/gnome/gtk-modules", NULL);
+        new_value = get_modules_string (cur_value, m->module_name, enabled);
+
+        if (new_value != cur_value ||
+            (new_value && cur_value && strcmp (new_value, cur_value))) {
+
+                if (new_value != NULL) {
+                        gconf_client_set_string (client, "/desktop/gnome/gtk-modules", new_value, NULL);
+                } else {
+                        gconf_client_unset (client, "/desktop/gnome/gtk-modules", NULL);
+                }
+        }
+        g_free (new_value);
+        g_free (cur_value);
+}
+
+static void
+setup_gtk_modules (GConfClient *client, GnomeXSettingsManager *manager)
+{
+        int i;
+
+        for (i = 0; i < G_N_ELEMENTS (gtk_module_mapping); ++i) {
+                GConfEntry *entry = gconf_client_get_entry (client,
+                                                            gtk_module_mapping[i].gconf_key,
+                                                            NULL, TRUE, NULL);
+                gtk_modules_callback (client, 0, entry, manager);
+
+                if (entry)
+                        gconf_entry_unref (entry);
+        }
+}
+
 static const char *
 type_to_string (GConfValueType type)
 {
@@ -777,8 +886,15 @@ gnome_xsettings_manager_start (GnomeXSet
                                           SOUND_SETTINGS_DIR,
                                           (GConfClientNotifyFunc) xsettings_callback);
 
-#ifdef HAVE_FONTCONFIG
         manager->priv->notify[4] =
+                gconf_client_notify_add (client,
+                                         SOUND_SETTINGS_DIR "/event_sounds",
+                                         (GConfClientNotifyFunc) gtk_modules_callback,
+                                         manager, NULL, NULL);
+        setup_gtk_modules (client, manager);
+
+#ifdef HAVE_FONTCONFIG
+        manager->priv->notify[5] =
                 register_config_callback (manager, client,
                                           FONT_RENDER_DIR,
                                           (GConfClientNotifyFunc) xft_callback);
