summaryrefslogtreecommitdiff
path: root/gio/gfdonotificationbackend.c
diff options
context:
space:
mode:
Diffstat (limited to 'gio/gfdonotificationbackend.c')
-rw-r--r--gio/gfdonotificationbackend.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gio/gfdonotificationbackend.c b/gio/gfdonotificationbackend.c
index e4b3ce48d..52d7a62df 100644
--- a/gio/gfdonotificationbackend.c
+++ b/gio/gfdonotificationbackend.c
@@ -243,6 +243,7 @@ call_notify (GDBusConnection *con,
const gchar *body;
guchar urgency;
const char *sound_name = NULL;
+ GFile *sound_file;
GNotificationSound sound;
g_variant_builder_init (&action_builder, G_VARIANT_TYPE_STRING_ARRAY);
@@ -326,6 +327,22 @@ call_notify (GDBusConnection *con,
if (sound == G_NOTIFICATION_SOUND_NONE)
g_variant_builder_add (&hints_builder, "{sv}", "suppress-sound", g_variant_new_boolean (TRUE));
+ sound_file = g_notification_get_sound_file (notification);
+ if (sound_file != NULL)
+ {
+ gchar *path = g_file_get_path (sound_file);
+ if (path != NULL && g_path_is_absolute (path))
+ {
+ gchar *path_utf8 = g_filename_to_utf8 (path, -1, NULL, NULL, NULL);
+ if (path_utf8 != NULL)
+ g_variant_builder_add (&hints_builder, "{sv}", "sound-file", g_variant_new_string (path_utf8));
+ g_free (path_utf8);
+ g_free (path);
+ }
+ else
+ g_warning ("Relative path passed to GNotification (%s)", path);
+ }
+
body = g_notification_get_body (notification);
parameters = g_variant_new ("(susssasa{sv}i)",