blob: ece59066f03064bde5ce5bd9b47fdad29bfa4438 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# HG changeset patch
# Parent 9d66436af432f057f65d16ab9f5871baca4ada78
# User Martin Stransky <stransky@redhat.com>
Bug 858919 - Send "alertshow" event for Web Notifications by libnotify, r=?karlt
diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp
--- a/toolkit/system/gnome/nsAlertsIconListener.cpp
+++ b/toolkit/system/gnome/nsAlertsIconListener.cpp
@@ -175,16 +175,19 @@ nsAlertsIconListener::ShowAlert(GdkPixbu
// different signature, so a marshaller is used instead of a C callback to
// get the user_data (this) in a parseable format. |closure| is created
// with a floating reference, which gets sunk by g_signal_connect_closure().
GClosure* closure = g_closure_new_simple(sizeof(GClosure), this);
g_closure_set_marshal(closure, notify_closed_marshal);
mClosureHandler = g_signal_connect_closure(mNotification, "closed", closure, FALSE);
gboolean result = notify_notification_show(mNotification, nullptr);
+ if (result && mAlertListener)
+ mAlertListener->Observe(nullptr, "alertshow", mAlertCookie.get());
+
return result ? NS_OK : NS_ERROR_FAILURE;
}
nsresult
nsAlertsIconListener::StartRequest(const nsAString & aImageUrl)
{
if (mIconRequest) {
// Another icon request is already in flight. Kill it.
|