Added support for the NotificationClosed and RequestClosed signals, along with request callbacks. I wonder if any of this works.

This commit is contained in:
Christian Hammond 2004-06-28 04:40:04 +00:00
parent 755f81fbe9
commit 29de19e1ac
2 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Sun Jun 27 21:39:13 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
* libnotify/notify.c:
- Added support for the NotificationClosed and RequestClosed signals,
along with request callbacks. I wonder if any of this works.
Sun Jun 27 20:23:00 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
* libnotify/notify.c:

View File

@ -117,7 +117,49 @@ _notify_dbus_message_iter_append_app_info(DBusMessageIter *iter)
static DBusHandlerResult
_filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data)
{
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
DBusMessageIter iter;
if (dbus_message_is_signal(message, NOTIFY_DBUS_CORE_INTERFACE,
"NotificationClosed"))
{
/* We can ignore this, pretty much. */
}
else if (dbus_message_is_signal(message, NOTIFY_DBUS_CORE_INTERFACE,
"RequestClosed"))
{
guint32 id, button;
NotifyRequestData *request_data;
dbus_message_iter_init(message, &iter);
id = dbus_message_iter_get_uint32(&iter);
dbus_message_iter_next(&iter);
button = dbus_message_iter_get_uint32(&iter);
request_data = g_hash_table_lookup(_request_ids, GINT_TO_POINTER(id));
if (request_data != NULL)
{
if (button >= request_data->num_buttons)
{
fprintf(stderr,
"Returned request button ID is greater than "
"the maximum number of buttons!\n");
}
else if (request_data->cbs[button] != NULL)
{
(request_data->cbs[button])(id, button,
request_data->user_data);
}
g_hash_table_remove(_request_ids, GINT_TO_POINTER(id));
}
}
else
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
return DBUS_HANDLER_RESULT_HANDLED;
}
static gboolean