Added support for the NotificationClosed and RequestClosed signals, along with request callbacks. I wonder if any of this works.
This commit is contained in:
parent
755f81fbe9
commit
29de19e1ac
|
@ -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>
|
Sun Jun 27 20:23:00 PDT 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
* libnotify/notify.c:
|
* libnotify/notify.c:
|
||||||
|
|
|
@ -117,7 +117,49 @@ _notify_dbus_message_iter_append_app_info(DBusMessageIter *iter)
|
||||||
static DBusHandlerResult
|
static DBusHandlerResult
|
||||||
_filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data)
|
_filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data)
|
||||||
{
|
{
|
||||||
|
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_NOT_YET_HANDLED;
|
||||||
|
|
||||||
|
return DBUS_HANDLER_RESULT_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in New Issue