MozillaThunderbird/mozilla-libnotify.patch
Wolfgang Rosenauer 2b3fd56291 - update to Thunderbird 12.0b5
- update Enigmail to 1.4.1
- added mozilla-revert_621446.patch
- added mozilla-libnotify.patch (bmo#737646)
- added mailnew-showalert.patch (bmo#739146)
- added mozilla-gcc47.patch and mailnews-literals.patch to fix
  compilation issues with recent gcc 4.7
- disabled crashreporter temporarily for Factory (gcc 4.7 issue)

OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaThunderbird?expand=0&rev=166
2012-04-20 21:16:28 +00:00

62 lines
1.9 KiB
Diff

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# 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
@@ -47,16 +47,17 @@
#include <gdk/gdk.h>
// Compatibility macro for <libnotify-0.7
#ifndef NOTIFY_CHECK_VERSION
#define NOTIFY_CHECK_VERSION(x,y,z) 0
#endif
static bool gHasActions = false;
+static bool gHasCaps = false;
static void notify_action_cb(NotifyNotification *notification,
gchar *action, gpointer user_data)
{
nsAlertsIconListener* alert = static_cast<nsAlertsIconListener*> (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;
break;
}
}
g_list_foreach(server_caps, (GFunc)g_free, NULL);
g_list_free(server_caps);
}
}
+ 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<nsIObserverService> obsServ =
do_GetService("@mozilla.org/observer-service;1");
if (obsServ)
obsServ->AddObserver(this, "quit-application", true);