diff -u mail-notification-5.4.dfsg.1/debian/changelog mail-notification-5.4.dfsg.1/debian/changelog --- mail-notification-5.4.dfsg.1/debian/changelog +++ mail-notification-5.4.dfsg.1/debian/changelog @@ -1,3 +1,13 @@ +mail-notification (5.4.dfsg.1-1ubuntu2) karmic; urgency=low + + * Support notify-osd's [lack of] actions and other options. + Specifically, disable actions if not supported, and disable positioning + and expiration if notify-osd is in use. Thanks to Dylan McCall for + the initial patch and Jonathan Lambrechts for the accompanying C source + of the actions solution. (LP: #332767) + + -- Jacob Peddicord Mon, 04 May 2009 20:25:17 -0400 + mail-notification (5.4.dfsg.1-1ubuntu1) jaunty; urgency=low * [debian/patches/02-fix_evolution_crash_on_startup.diff]: only in patch2: unchanged: --- mail-notification-5.4.dfsg.1.orig/debian/patches/03-notify_osd.diff +++ mail-notification-5.4.dfsg.1/debian/patches/03-notify_osd.diff @@ -0,0 +1,210 @@ +diff -Nurp build/src/mn-popup.c build/src/mn-popup.c +--- build/src/mn-popup.c 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-popup.c 2009-05-04 19:11:00.000000000 -0400 +@@ -304,7 +304,8 @@ mn_popup_constructor (MNPopup * self) + + g_string_free(body, TRUE); + +- self_add_actions(self); ++ if ( mn_popups_can_use_actions == 1 ) ++ self_add_actions(self); + + notify_notification_set_timeout(NOTIFY_NOTIFICATION(self), self_get_conf_timeout()); + +diff -Nurp build/src/mn-popup.gob.stamp build/src/mn-popup.gob.stamp +--- build/src/mn-popup.gob.stamp 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-popup.gob.stamp 2009-05-04 19:12:31.000000000 -0400 +@@ -0,0 +1 @@ ++notify-osd patch +diff -Nurp build/src/mn-popups.c build/src/mn-popups.c +--- build/src/mn-popups.c 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-popups.c 2009-05-04 19:11:00.000000000 -0400 +@@ -196,6 +196,8 @@ mn_popups_init (MNPopups * self G_GNUC_U + MN_CONF_POPUPS_NAMESPACE, self_notify_cb, self, + NULL); + ++ self->server_caps = notify_get_server_caps(); ++ self->server_caps_actions = g_list_find(self->server_caps,"actions" ) != NULL; + g_signal_connect(mn_shell->mailboxes, "messages-changed", G_CALLBACK(self_messages_changed_h), self); + + #line 202 "mn-popups.c" +@@ -528,4 +530,10 @@ mn_popups_new (void) + return GET_NEW; + }} + #line 531 "mn-popups.c" ++ + #undef __GOB_FUNCTION__ ++int mn_popups_can_use_actions(MNPopups *self) ++{ ++ return self->server_caps_actions; ++} ++ +diff -Nurp build/src/mn-popups.gob.stamp build/src/mn-popups.gob.stamp +--- build/src/mn-popups.gob.stamp 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-popups.gob.stamp 2009-05-04 19:12:30.000000000 -0400 +@@ -0,0 +1 @@ ++notify-osd patch +diff -Nurp build/src/mn-popups.h build/src/mn-popups.h +--- build/src/mn-popups.h 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-popups.h 2009-05-04 19:11:00.000000000 -0400 +@@ -33,6 +33,9 @@ typedef struct _MNPopups MNPopups; + #endif + struct _MNPopups { + GObject __parent__; ++ /*< public >*/ ++ GList *server_caps; ++ int server_caps_actions; + /*< private >*/ + MNPopupsPrivate *_priv; + }; +@@ -53,6 +56,7 @@ GType mn_popups_get_type (void) G_GNUC_C + #line 265 "src/mn-popups.gob" + MNPopups * mn_popups_new (void); + #line 56 "mn-popups.h" ++int mn_popups_can_use_actions(MNPopups *self); + + #ifdef __cplusplus + } +diff -Nurp build/src/mn-properties-dialog.c build/src/mn-properties-dialog.c +--- build/src/mn-properties-dialog.c 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-properties-dialog.c 2009-05-04 19:56:09.000000000 -0400 +@@ -24,6 +24,8 @@ + + #line 28 "src/mn-properties-dialog.gob" + ++#include ++#include + #include + #include + #include "mn-conf.h" +@@ -413,6 +415,10 @@ mn_properties_dialog_update_sensitivity + gboolean has_selection; + gboolean popups_enabled; + gboolean popups_expiration_after_enabled; ++ gchar *notify_name; ++ gchar *notify_vendor; ++ gchar *notify_version; ++ gchar *notify_spec_version; + + play_sound_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->play_sound_check)); + +@@ -435,6 +441,22 @@ mn_properties_dialog_update_sensitivity + gtk_widget_set_sensitive(selfp->popups_expiration_never_radio, popups_enabled); + gtk_widget_set_sensitive(selfp->popups_expiration_after_radio, popups_enabled); + gtk_widget_set_sensitive(selfp->popups_expiration_scale, popups_enabled && popups_expiration_after_enabled); ++ ++ /* Notify-OSD */ ++ if (notify_get_server_info(¬ify_name, ¬ify_vendor, ¬ify_version, ¬ify_spec_version)) ++ { ++ if (! strcmp(notify_name, "notify-osd")) ++ { ++ gtk_widget_set_sensitive(selfp->popups_position_section_label, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_position_attached_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_position_free_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_section_label, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_default_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_never_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_after_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_scale, FALSE); ++ } ++ } + }} + #line 440 "mn-properties-dialog.c" + #undef __GOB_FUNCTION__ +diff -Nurp build/src/mn-properties-dialog.gob.stamp build/src/mn-properties-dialog.gob.stamp +--- build/src/mn-properties-dialog.gob.stamp 2008-05-22 11:47:49.000000000 -0400 ++++ build/src/mn-properties-dialog.gob.stamp 2009-05-04 20:01:19.000000000 -0400 +@@ -0,0 +1 @@ ++notify-osd patch +diff -Nurp src/mn-popup.gob src/mn-popup.gob +--- src/mn-popup.gob 2008-05-22 11:45:36.000000000 -0400 ++++ src/mn-popup.gob 2009-05-04 19:10:57.000000000 -0400 +@@ -56,7 +56,8 @@ class MN:Popup from Notify:Notification + + g_string_free(body, TRUE); + +- self_add_actions(self); ++ if ( mn_popups_can_use_actions == 1 ) ++ self_add_actions(self); + + notify_notification_set_timeout(NOTIFY_NOTIFICATION(self), self_get_conf_timeout()); + +diff -Nurp src/mn-popups.gob src/mn-popups.gob +--- src/mn-popups.gob 2008-05-22 11:45:36.000000000 -0400 ++++ src/mn-popups.gob 2009-05-04 19:10:57.000000000 -0400 +@@ -36,6 +36,8 @@ class MN:Popups + * encountered), the value is NULL. + */ + private GHashTable *popups = {g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) mn_g_object_null_unref)} destroywith g_hash_table_destroy; ++ public GList *server_caps; ++ public bool *server_caps_actions; + + init (self) + { +@@ -45,6 +47,9 @@ class MN:Popups + mn_g_object_gconf_notifications_add_gdk_locked(self, + MN_CONF_POPUPS_NAMESPACE, self_notify_cb, self, + NULL); ++ ++ mn_popups_server_caps = notify_get_server_caps(); ++ mn_popups_server_caps_actions = g_list_find(mn_popups_server_caps,"actions") != NULL; + + g_signal_connect(mn_shell->mailboxes, "messages-changed", G_CALLBACK(self_messages_changed_h), self); + } +@@ -267,4 +272,10 @@ class MN:Popups + { + return GET_NEW; + } ++ ++ public bool can_use_actions(void) ++ { ++ /* Returns True if notification server will make use of actions, False if not */ ++ return mn_popups_server_caps_actions; ++ } + } +diff -Nurp src/mn-properties-dialog.gob src/mn-properties-dialog.gob +--- src/mn-properties-dialog.gob 2008-05-22 11:45:36.000000000 -0400 ++++ src/mn-properties-dialog.gob 2009-05-04 19:53:08.000000000 -0400 +@@ -26,6 +26,8 @@ + %} + + %{ ++#include ++#include + #include + #include + #include "mn-conf.h" +@@ -250,6 +252,10 @@ class MN:Properties:Dialog from MN:Dialo + gboolean has_selection; + gboolean popups_enabled; + gboolean popups_expiration_after_enabled; ++ gchar *notify_name; ++ gchar *notify_vendor; ++ gchar *notify_version; ++ gchar *notify_spec_version; + + play_sound_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(selfp->play_sound_check)); + +@@ -272,6 +278,22 @@ class MN:Properties:Dialog from MN:Dialo + gtk_widget_set_sensitive(selfp->popups_expiration_never_radio, popups_enabled); + gtk_widget_set_sensitive(selfp->popups_expiration_after_radio, popups_enabled); + gtk_widget_set_sensitive(selfp->popups_expiration_scale, popups_enabled && popups_expiration_after_enabled); ++ ++ /* Notify-OSD */ ++ if (notify_get_server_info(¬ify_name, ¬ify_vendor, ¬ify_version, ¬ify_spec_version)) ++ { ++ if (! strcmp(notify_name, "notify-osd")) ++ { ++ gtk_widget_set_sensitive(selfp->popups_position_section_label, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_position_attached_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_position_free_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_section_label, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_default_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_never_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_after_radio, FALSE); ++ gtk_widget_set_sensitive(selfp->popups_expiration_scale, FALSE); ++ } ++ } + } + + /* libglade callbacks */