This commit is contained in:
Matthias Clasen 2008-11-23 02:14:02 +00:00
parent ef4c0eff7c
commit 80f803d0a1
5 changed files with 16 additions and 195 deletions

View File

@ -1 +1 @@
libnotify-0.4.4.tar.bz2
libnotify-0.4.5.tar.bz2

View File

@ -1,105 +0,0 @@
diff -U0 libnotify-0.4.4/ChangeLog.closed-reason libnotify-0.4.4/ChangeLog
--- libnotify-0.4.4/ChangeLog.closed-reason 2007-02-28 05:11:47.000000000 +0000
+++ libnotify-0.4.4/ChangeLog 2008-08-14 15:35:07.000000000 +0100
@@ -0,0 +1,10 @@
+Tue Mar 18 21:51:32 PDT 2008 Christian Hammond <chipx86@chipx86.com>
+
+ * libnotify/notification.c:
+ * libnotify/notification.h:
+ * libnotify/notify.c:
+ * libnotify/notify-marshal.list:
+ * NEWS:
+ - Add support for sending the closed reason in the signal handler.
+ Closes ticket #139.
+
diff -up libnotify-0.4.4/libnotify/notification.c.closed-reason libnotify-0.4.4/libnotify/notification.c
--- libnotify-0.4.4/libnotify/notification.c.closed-reason 2008-08-14 15:34:40.000000000 +0100
+++ libnotify-0.4.4/libnotify/notification.c 2008-08-14 15:35:07.000000000 +0100
@@ -47,7 +47,7 @@
static void notify_notification_class_init(NotifyNotificationClass *klass);
static void notify_notification_init(NotifyNotification *sp);
static void notify_notification_finalize(GObject *object);
-static void _close_signal_handler(DBusGProxy *proxy, guint32 id,
+static void _close_signal_handler(DBusGProxy *proxy, guint32 id, guint32 reason,
NotifyNotification *notification);
static void _action_signal_handler(DBusGProxy *proxy, guint32 id,
@@ -155,7 +155,7 @@ notify_notification_class_init(NotifyNot
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET(NotifyNotificationClass, closed),
NULL, NULL,
- g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+ g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_INT);
g_object_class_install_property(object_class, PROP_SUMMARY,
g_param_spec_string("summary", "Summary",
@@ -678,13 +678,13 @@ notify_notification_set_geometry_hints(N
}
static void
-_close_signal_handler(DBusGProxy *proxy, guint32 id,
+_close_signal_handler(DBusGProxy *proxy, guint32 id, guint32 reason,
NotifyNotification *notification)
{
if (id == notification->priv->id)
{
g_object_ref(G_OBJECT(notification));
- g_signal_emit(notification, signals[SIGNAL_CLOSED], 0);
+ g_signal_emit(notification, signals[SIGNAL_CLOSED], 0, reason);
notification->priv->id = 0;
g_object_unref(G_OBJECT(notification));
}
diff -up libnotify-0.4.4/libnotify/notification.h.closed-reason libnotify-0.4.4/libnotify/notification.h
--- libnotify-0.4.4/libnotify/notification.h.closed-reason 2008-08-14 15:34:40.000000000 +0100
+++ libnotify-0.4.4/libnotify/notification.h 2008-08-14 15:35:07.000000000 +0100
@@ -63,7 +63,7 @@ struct _NotifyNotificationClass
GObjectClass parent_class;
/* Signals */
- void (*closed)(NotifyNotification *notification);
+ void (*closed)(NotifyNotification *notification, gint reason);
};
/*
diff -up libnotify-0.4.4/libnotify/notify.c.closed-reason libnotify-0.4.4/libnotify/notify.c
--- libnotify-0.4.4/libnotify/notify.c.closed-reason 2007-02-15 10:28:46.000000000 +0000
+++ libnotify-0.4.4/libnotify/notify.c 2008-08-14 15:35:07.000000000 +0100
@@ -72,13 +72,19 @@ notify_init(const char *app_name)
NOTIFY_DBUS_CORE_INTERFACE);
dbus_g_connection_unref(bus);
+ dbus_g_object_register_marshaller(notify_marshal_VOID__UINT_UINT,
+ G_TYPE_NONE,
+ G_TYPE_UINT,
+ G_TYPE_UINT, G_TYPE_INVALID);
+
dbus_g_object_register_marshaller(notify_marshal_VOID__UINT_STRING,
G_TYPE_NONE,
G_TYPE_UINT,
G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_add_signal(_proxy, "NotificationClosed",
- G_TYPE_UINT, G_TYPE_INVALID);
+ G_TYPE_UINT, G_TYPE_UINT,
+ G_TYPE_INVALID);
dbus_g_proxy_add_signal(_proxy, "ActionInvoked",
G_TYPE_UINT, G_TYPE_STRING,
G_TYPE_INVALID);
diff -up libnotify-0.4.4/libnotify/notify-marshal.list.closed-reason libnotify-0.4.4/libnotify/notify-marshal.list
--- libnotify-0.4.4/libnotify/notify-marshal.list.closed-reason 2006-01-11 07:49:04.000000000 +0000
+++ libnotify-0.4.4/libnotify/notify-marshal.list 2008-08-14 15:35:07.000000000 +0100
@@ -1 +1,2 @@
+VOID:UINT,UINT
VOID:UINT,STRING
diff -up libnotify-0.4.4/NEWS.closed-reason libnotify-0.4.4/NEWS
--- libnotify-0.4.4/NEWS.closed-reason 2007-02-28 05:07:27.000000000 +0000
+++ libnotify-0.4.4/NEWS 2008-08-14 15:35:07.000000000 +0100
@@ -1,6 +1,8 @@
version 0.4.4 (27-February-2007):
* Fixed a bug where a notification's ID could be reset when a different
notification was closed. Patch by jylefort. (Bug #94)
+ * Added support for sending the closed reason in the "closed" signal
+ handler. (Ticket #139)
* Fixed a crash when the D-BUS proxy was not being freed on notify_uninit,
which was problematic when used in a loadable module. (Bug #92)
* Fixed a crash when a signal handler for the notification's closed signal

View File

@ -1,73 +0,0 @@
Index: libnotify/notification.c
===================================================================
--- libnotify/notification.c (revision 3009)
+++ libnotify/notification.c (working copy)
@@ -31,6 +31,7 @@
# define HAVE_STATUS_ICON
# include <gtk/gtkstatusicon.h>
#endif
+#include <gdk/gdkx.h>
#define CHECK_DBUS_VERSION(major, minor) \
(DBUS_MAJOR_VER > (major) || \
@@ -408,6 +409,13 @@
{
GdkRectangle rect;
+#if GTK_CHECK_VERSION(2,12,10)
+ {
+ guint32 xid = gtk_status_icon_get_x11_window_id(priv->status_icon);
+ notify_notification_set_hint_uint32(n, "window-xid", xid);
+ }
+#endif
+
if (!gtk_status_icon_get_geometry(priv->status_icon, &screen,
&rect, NULL))
{
@@ -1003,7 +1011,33 @@
g_strdup(key), hint_value);
}
+
/**
+ * notify_notification_set_hint_uint32:
+ * @notification: The notification.
+ * @key: The hint.
+ * @value: The hint's value.
+ *
+ * Sets a hint with an unsigned 32-bit integer value.
+ */
+void
+notify_notification_set_hint_uint32(NotifyNotification *notification,
+ const gchar *key, guint value)
+{
+ GValue *hint_value;
+
+ g_return_if_fail(notification != NULL);
+ g_return_if_fail(NOTIFY_IS_NOTIFICATION(notification));
+ g_return_if_fail(key != NULL && *key != '\0');
+
+ hint_value = g_new0(GValue, 1);
+ g_value_init(hint_value, G_TYPE_UINT);
+ g_value_set_uint(hint_value, value);
+ g_hash_table_insert(notification->priv->hints,
+ g_strdup(key), hint_value);
+}
+
+/**
* notify_notification_set_hint_double:
* @notification: The notification.
* @key: The hint.
Index: libnotify/notification.h
===================================================================
--- libnotify/notification.h (revision 3009)
+++ libnotify/notification.h (working copy)
@@ -128,6 +128,8 @@
void notify_notification_set_hint_int32(NotifyNotification *notification,
const gchar *key, gint value);
+void notify_notification_set_hint_uint32(NotifyNotification *notification,
+ const gchar *key, guint value);
void notify_notification_set_hint_double(NotifyNotification *notification,
const gchar *key, gdouble value);

View File

@ -5,16 +5,12 @@
%define dbus_version 0.90
%define dbus_glib_version 0.70
Summary: libnotify notification library
Summary: Desktop notification library
Name: libnotify
Version: 0.4.4
Release: 12%{?dist}
Version: 0.4.5
Release: 1%{?dist}
URL: http://www.galago-project.org/specs/notification/
Source0: http://www.galago-project.org/files/releases/source/%{name}/%{name}-%{version}.tar.bz2
# Sent upstream via email
Patch0: libnotify-send-xid-2.patch
# From upstream, changeset 3005
Patch1: libnotify-closed-reason.patch
License: LGPLv2+
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -27,12 +23,13 @@ Requires: glib2 >= %{glib2_version}
Requires: desktop-notification-daemon
%description
libnotify is an implementation of the freedesktop.org desktop
notification specification.
libnotify is a library for sending desktop notifications to a notification
daemon, as defined in the freedesktop.org Desktop Notifications spec. These
notifications can be used to inform the user about an event or display some
form of information without getting in the user's way.
%package devel
Summary: Files for development using %{name}
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: glib2-devel >= %{glib2_version}
@ -42,14 +39,11 @@ Requires: dbus-glib-devel >= %{dbus_glib_version}
Requires: pkgconfig
%description devel
This package contains the headers and pkg-config file for
This package contains libraries and header files needed for
development of programs using %{name}.
%prep
%setup -q
%patch0 -p0 -b .send-xid
%patch1 -p1 -b .closed-reason
%build
@ -90,6 +84,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gtk-doc/html/libnotify/*
%changelog
* Sat Nov 22 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.5-1
- Update to 0.4.5
- Drop obsolete patches
- Tweak %%summary and %%description
* Sat Aug 23 2008 Matthias Clasen <mclasen@redhat.com> - 0.4.4-12
- Handle extra parameter of the closed signal

View File

@ -1 +1 @@
0a739819b907fd8ec79a9bc9dbcb42c1 libnotify-0.4.4.tar.bz2
6a8388f93309dbe336bbe5fc0677de6b libnotify-0.4.5.tar.bz2