From 732437ffc0a4ad12f02d867b343202441cb45eb1 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sat, 9 Jan 2010 13:04:32 -0500 Subject: [PATCH] Depend on Gtk+ 2.10 for StatusIcon --- configure.ac | 2 +- libnotify/notification.c | 22 +--------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index d077f45..4f7b847 100644 --- a/configure.ac +++ b/configure.ac @@ -83,7 +83,7 @@ AC_EXEEXT AM_PROG_LIBTOOL REQ_DBUS_VERSION=0.76 -REQ_GTK_VERSION=2.6 +REQ_GTK_VERSION=2.10 REQ_GLIB_VERSION=2.6 pkg_modules="gtk+-2.0 >= $REQ_GTK_VERSION, glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION" AC_SUBST(pkg_modules) diff --git a/libnotify/notification.c b/libnotify/notification.c index c7447bf..76ace75 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -28,9 +28,6 @@ #include #include -#if GTK_CHECK_VERSION(2, 9, 2) -# define HAVE_STATUS_ICON -#endif #include #define CHECK_DBUS_VERSION(major, minor) \ @@ -83,9 +80,7 @@ struct _NotifyNotificationPrivate GHashTable *hints; GtkWidget *attached_widget; -#ifdef HAVE_STATUS_ICON GtkStatusIcon *status_icon; -#endif gboolean has_nondefault_actions; gboolean updates_pending; @@ -215,7 +210,6 @@ notify_notification_class_init(NotifyNotificationClass *klass) G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); -#ifdef HAVE_STATUS_ICON g_object_class_install_property(object_class, PROP_STATUS_ICON, g_param_spec_object("status-icon", "Status Icon", @@ -226,7 +220,6 @@ notify_notification_class_init(NotifyNotificationClass *klass) G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); -#endif /* HAVE_STATUS_ICON */ g_object_class_install_property(object_class, PROP_CLOSED_REASON, g_param_spec_int("closed-reason", "Closed Reason", @@ -276,12 +269,10 @@ notify_notification_set_property(GObject *object, g_value_get_object(value)); break; -#ifdef HAVE_STATUS_ICON case PROP_STATUS_ICON: notify_notification_attach_to_status_icon(notification, g_value_get_object(value)); break; -#endif default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -320,11 +311,9 @@ notify_notification_get_property(GObject *object, g_value_set_object(value, priv->attached_widget); break; -#ifdef HAVE_STATUS_ICON case PROP_STATUS_ICON: g_value_set_object(value, priv->status_icon); break; -#endif case PROP_CLOSED_REASON: g_value_set_int(value, priv->closed_reason); @@ -395,11 +384,9 @@ notify_notification_finalize(GObject *object) if (priv->attached_widget != NULL) g_object_unref(G_OBJECT(priv->attached_widget)); -#ifdef HAVE_STATUS_ICON if (priv->status_icon != NULL) g_object_remove_weak_pointer(G_OBJECT(priv->status_icon), (gpointer)&priv->status_icon); -#endif if (priv->signals_registered) { @@ -430,7 +417,6 @@ _notify_notification_update_applet_hints(NotifyNotification *n) GdkScreen *screen = NULL; gint x, y; -#ifdef HAVE_STATUS_ICON if (priv->status_icon != NULL) { GdkRectangle rect; @@ -456,9 +442,7 @@ _notify_notification_update_applet_hints(NotifyNotification *n) x = rect.x + rect.width / 2; y = rect.y + rect.height / 2; } - else -#endif /* HAVE_STATUS_ICON */ - if (priv->attached_widget != NULL) + else if (priv->attached_widget != NULL) { GtkWidget *widget = priv->attached_widget; @@ -542,7 +526,6 @@ notify_notification_new(const gchar *summary, NULL); } -#ifdef HAVE_STATUS_ICON /** * notify_notification_new_with_status_icon: * @summary: The required summary text. @@ -574,7 +557,6 @@ notify_notification_new_with_status_icon(const gchar *summary, "status-icon", status_icon, NULL); } -#endif /* HAVE_STATUS_ICON */ /** * notify_notification_update: @@ -654,7 +636,6 @@ notify_notification_attach_to_widget(NotifyNotification *notification, g_object_notify(G_OBJECT(notification), "attach-widget"); } -#ifdef HAVE_STATUS_ICON /** * notify_notification_attach_to_status_icon: * @notification: The notification. @@ -696,7 +677,6 @@ notify_notification_attach_to_status_icon(NotifyNotification *notification, g_object_notify(G_OBJECT(notification), "status-icon"); } -#endif /* HAVE_STATUS_ICON */ /** * notify_notification_set_geometry_hints: