diff -u bluez-gnome-1.8/debian/changelog bluez-gnome-1.8/debian/changelog --- bluez-gnome-1.8/debian/changelog +++ bluez-gnome-1.8/debian/changelog @@ -1,8 +1,16 @@ +bluez-gnome (1.8-0ubuntu5) jaunty; urgency=low + + * debian/patches/11_bluez-notifications.patch: Check for capabilities of the + notification daemon and do the right thing (LP: #337219) + + -- Ken VanDine Wed, 25 Mar 2009 17:12:35 -0400 + bluez-gnome (1.8-0ubuntu4) jaunty; urgency=low + [ Colin Watson ] * No-change rebuild to fix lpia shared library dependencies. - -- Colin Watson Thu, 19 Mar 2009 12:22:45 +0000 + -- Ken VanDine Wed, 25 Mar 2009 17:11:57 -0400 bluez-gnome (1.8-0ubuntu3) jaunty; urgency=low only in patch2: unchanged: --- bluez-gnome-1.8.orig/debian/patches/11_bluez-notifications.patch +++ bluez-gnome-1.8/debian/patches/11_bluez-notifications.patch @@ -0,0 +1,168 @@ +=== modified file 'applet/agent.c' +--- old/applet/agent.c 2008-10-30 18:07:50 +0000 ++++ new/applet/agent.c 2009-03-27 14:45:19 +0000 +@@ -258,7 +258,10 @@ + gtk_window_set_title(GTK_WINDOW(dialog), _("Authentication request")); + gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); +- gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); ++ if (supports_actions ()) ++ gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); ++ else ++ gtk_window_set_focus_on_map(GTK_WINDOW(dialog), FALSE); + gtk_window_set_urgency_hint(GTK_WINDOW(dialog), TRUE); + gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); + input->dialog = dialog; +@@ -530,13 +533,18 @@ + gtk_window_present(GTK_WINDOW(input->dialog)); + } + +-static void notification_closed(GObject *object, gpointer user_data) ++static void present_notification_dialogs () + { + g_list_foreach(input_list, show_dialog, NULL); + + disable_blinking(); + } + ++static void notification_closed (GObject *object, gpointer user_data) ++{ ++ present_notification_dialogs (); ++} ++ + #ifndef DBUS_TYPE_G_DICTIONARY + #define DBUS_TYPE_G_DICTIONARY \ + (dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +@@ -587,9 +595,12 @@ + + g_free(name); + +- show_notification(_("Bluetooth device"), +- line, _("Enter PIN code"), 0, +- G_CALLBACK(notification_closed)); ++ if (supports_actions ()) ++ show_notification(_("Bluetooth device"), ++ line, _("Enter PIN code"), 0, ++ G_CALLBACK(notification_closed)); ++ else ++ present_notification_dialogs (); + + g_free(line); + +@@ -634,9 +645,12 @@ + + g_free(name); + +- show_notification(_("Bluetooth device"), +- line, _("Enter passkey"), 0, +- G_CALLBACK(notification_closed)); ++ if (supports_actions ()) ++ show_notification(_("Bluetooth device"), ++ line, _("Enter passkey"), 0, ++ G_CALLBACK(notification_closed)); ++ else ++ present_notification_dialogs (); + + g_free(line); + +@@ -684,9 +698,12 @@ + + g_free(name); + +- show_notification(_("Bluetooth device"), +- line, _("Enter passkey"), 0, +- G_CALLBACK(notification_closed)); ++ if (supports_actions ()) ++ show_notification(_("Bluetooth device"), ++ line, _("Enter passkey"), 0, ++ G_CALLBACK(notification_closed)); ++ else ++ present_notification_dialogs (); + + g_free(line); + +@@ -733,9 +750,12 @@ + + g_free(name); + +- show_notification(_("Bluetooth device"), +- line, _("Confirm passkey"), 0, +- G_CALLBACK(notification_closed)); ++ if (supports_actions ()) ++ show_notification(_("Bluetooth device"), ++ line, _("Confirm passkey"), 0, ++ G_CALLBACK(notification_closed)); ++ else ++ present_notification_dialogs (); + + g_free(line); + +@@ -778,9 +798,12 @@ + + g_free(name); + +- show_notification(_("Bluetooth device"), +- line, _("Check authorization"), 0, +- G_CALLBACK(notification_closed)); ++ if (supports_actions ()) ++ show_notification(_("Bluetooth device"), ++ line, _("Check authorization"), 0, ++ G_CALLBACK(notification_closed)); ++ else ++ present_notification_dialogs (); + + g_free(line); + + +=== modified file 'applet/notify.c' +--- old/applet/notify.c 2008-10-30 18:07:50 +0000 ++++ new/applet/notify.c 2009-03-27 14:42:17 +0000 +@@ -38,6 +38,35 @@ + { + } + ++gboolean ++supports_actions () ++{ ++ static gboolean supports_actions = FALSE; ++ static gboolean have_checked = FALSE; ++ ++ if (!have_checked) { ++ GList *caps = NULL; ++ GList *c; ++ ++ have_checked = TRUE; ++ ++ caps = notify_get_server_caps (); ++ if (caps != NULL) { ++ for (c = caps; c != NULL; c = c->next) { ++ if (strcmp ((char*)c->data, "actions") == 0) { ++ supports_actions = TRUE; ++ break; ++ } ++ } ++ ++ g_list_foreach (caps, (GFunc)g_free, NULL); ++ g_list_free (caps); ++ } ++ } ++ ++ return supports_actions; ++} ++ + void show_notification(const gchar *summary, const gchar *message, + const gchar *action, gint timeout, GCallback handler) + { + +=== modified file 'applet/notify.h' +--- old/applet/notify.h 2008-10-30 18:07:50 +0000 ++++ new/applet/notify.h 2009-03-27 14:42:47 +0000 +@@ -25,6 +25,7 @@ + GtkStatusIcon *init_notification(void); + void cleanup_notification(void); + ++gboolean supports_actions(); + void show_notification(const gchar *summary, const gchar *message, + const gchar *action, gint timeout, GCallback handler); + void close_notification(void); +