From 1ce34fb8d276037c48da3121291a97d9501cc96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 13 Apr 2016 06:08:35 +0200 Subject: [PATCH] LibnotifyNotification: add support for notification tag We set the id of the notification if tag is provided. As per the protocol, this should cause the old notification with same ID to be replaced. --- brightray/browser/linux/libnotify_notification.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/brightray/browser/linux/libnotify_notification.cc b/brightray/browser/linux/libnotify_notification.cc index bd94ef35a6..37aef60713 100644 --- a/brightray/browser/linux/libnotify_notification.cc +++ b/brightray/browser/linux/libnotify_notification.cc @@ -119,6 +119,11 @@ void LibnotifyNotification::Show(const base::string16& title, g_object_unref(pixbuf); } + if (!tag.empty()) { + GQuark id = g_quark_from_string(tag.c_str()); + g_object_set(G_OBJECT(notification_), "id", id, NULL); + } + GError* error = nullptr; libnotify_loader_.notify_notification_show(notification_, &error); if (error) {