mirror of
https://github.com/electron/electron.git
synced 2026-02-03 03:35:29 -05:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user