# HG changeset patch # User Wolfgang Rosenauer # Date 1332743408 -7200 # Node ID 62102cc5132a99e7e4ae6fa876499030cbc17ae8 # Parent 72a48d62899839fd80eaaca74c0170bed2d528aa fix mozilla-libnotify.patch diff -r 72a48d628998 -r 62102cc5132a mozilla-libnotify.patch --- a/mozilla-libnotify.patch Fri Mar 23 21:50:00 2012 +0100 +++ b/mozilla-libnotify.patch Mon Mar 26 08:30:08 2012 +0200 @@ -1,12 +1,39 @@ # HG changeset patch # User Wolfgang Rosenauer -# Parent 629ea8797e7393eb6e9add489db2c5636516b305 +# Parent c684863b1eb3bcae92ef24bc2ac511985b1ad7e4 Bug 737646 - no biff notification if notification-daemon not running 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 -@@ -346,16 +346,21 @@ nsAlertsIconListener::InitAlertAsync(con +@@ -47,16 +47,17 @@ + #include + + // Compatibility macro for (user_data); + alert->SendCallback(); + } + +@@ -338,27 +339,34 @@ nsAlertsIconListener::InitAlertAsync(con + appShortName.AssignLiteral("Mozilla"); + } + + if (!notify_init(appShortName.get())) + return NS_ERROR_FAILURE; + + GList *server_caps = notify_get_server_caps(); + if (server_caps) { ++ gHasCaps = true; for (GList* cap = server_caps; cap != NULL; cap = cap->next) { if (!strcmp((char*) cap->data, "actions")) { gHasActions = true; @@ -15,16 +42,20 @@ } g_list_foreach(server_caps, (GFunc)g_free, NULL); g_list_free(server_caps); -+ } else { -+ // notify_get_server_caps() is expected to return something -+ // otherwise we need to assume there is no notification-server -+ // to display anything -+ return NS_ERROR_FAILURE; } } ++ if (!gHasCaps) { ++ // if notify_get_server_caps() failed above we need to assume ++ // there is no notification-server to display anything ++ return NS_ERROR_FAILURE; ++ } ++ if (!gHasActions && aAlertTextClickable) return NS_ERROR_FAILURE; // No good, fallback to XUL nsCOMPtr obsServ = do_GetService("@mozilla.org/observer-service;1"); + if (obsServ) + obsServ->AddObserver(this, "quit-application", true); +