diff options
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/dbus-menu.xml | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem-marshal.list | 1 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 10 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.h | 4 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 6 |
6 files changed, 15 insertions, 10 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index e0879d4..720c8e2 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -633,7 +633,7 @@ menuitem_activate (DbusmenuMenuitem * mi, DbusmenuClient * client) GValue value = {0}; g_value_init(&value, G_TYPE_INT); g_value_set_int(&value, 0); - org_ayatana_dbusmenu_event_async (priv->menuproxy, dbusmenu_menuitem_get_id(mi), "clicked", &value, menuitem_call_cb, mi); + org_ayatana_dbusmenu_event_async (priv->menuproxy, dbusmenu_menuitem_get_id(mi), "clicked", &value, 0, menuitem_call_cb, mi); return; } diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 4c7446d..866969e 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -141,6 +141,7 @@ menu item. @param id the id of the item which received the event @param type the type of event @param data event-specific data +@param timestamp The time that the event occured if available or the time the message was sent if not. @a type can be one of the following: @@ -153,6 +154,7 @@ Vendor specific events can be added by prefixing them with "x-<vendor>-" <arg type="u" name="id" direction="in" /> <arg type="s" name="eventId" direction="in" /> <arg type="v" name="data" direction="in" /> + <arg type="u" name="timestamp" direction="in" /> </method> <!-- Signals --> diff --git a/libdbusmenu-glib/menuitem-marshal.list b/libdbusmenu-glib/menuitem-marshal.list index dc4ba53..654c91b 100644 --- a/libdbusmenu-glib/menuitem-marshal.list +++ b/libdbusmenu-glib/menuitem-marshal.list @@ -3,3 +3,4 @@ VOID: OBJECT, UINT, UINT VOID: OBJECT, UINT VOID: OBJECT VOID: VOID +VOID: UINT diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 0dcbade..06d6200 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -127,6 +127,7 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) /** DbusmenuMenuitem::item-activated: @arg0: The #DbusmenuMenuitem object. + @arg1: The timestamp of when it was activated Emitted on the objects on the server side when they are signaled on the client side. @@ -136,8 +137,8 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(DbusmenuMenuitemClass, item_activated), NULL, NULL, - _dbusmenu_menuitem_marshal_VOID__VOID, - G_TYPE_NONE, 0, G_TYPE_NONE); + _dbusmenu_menuitem_marshal_VOID__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT, G_TYPE_NONE); /** DbusmenuMenuitem::child-added: @arg0: The #DbusmenuMenuitem which is the parent. @@ -1117,18 +1118,19 @@ dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem /** dbusmenu_menuitem_activate: @mi: The #DbusmenuMenuitem to send the signal on. + @timestamp: The timestamp of when the event happened Emits the #DbusmenuMenuitem::item-activate signal on this menu item. Called by server objects when they get the appropriate DBus signals from the client. */ void -dbusmenu_menuitem_activate (DbusmenuMenuitem * mi) +dbusmenu_menuitem_activate (DbusmenuMenuitem * mi, guint timestamp) { g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) activated", ID(mi), LABEL(mi)); #endif - g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, TRUE); + g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, timestamp, TRUE); return; } diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index aaafe17..238b7d9 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -104,7 +104,7 @@ struct _DbusmenuMenuitemClass /* Signals */ void (*property_changed) (gchar * property, GValue * value); - void (*item_activated) (void); + void (*item_activated) (guint timestamp); void (*child_added) (DbusmenuMenuitem * child, guint position); void (*child_removed) (DbusmenuMenuitem * child); void (*child_moved) (DbusmenuMenuitem * child, guint newpos, guint oldpos); @@ -153,7 +153,7 @@ void dbusmenu_menuitem_set_root (DbusmenuMenuitem * mi, gboolean root); gboolean dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi); void dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data); -void dbusmenu_menuitem_activate (DbusmenuMenuitem * mi); +void dbusmenu_menuitem_activate (DbusmenuMenuitem * mi, guint timestamp); /** SECTION:menuitem diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index e307d95..afcbfd3 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -39,7 +39,7 @@ static gboolean _dbusmenu_server_get_layout (DbusmenuServer * server, guint pare static gboolean _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * property, gchar ** value, GError ** error); static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error); static gboolean _dbusmenu_server_get_group_properties (DbusmenuServer * server, GArray * ids, GArray * properties, GHashTable ** values, GError ** error); -static gboolean _dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, GError ** error); +static gboolean _dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error); static gboolean _dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * properties, GPtrArray ** output, GError ** error); #include "dbusmenu-server.h" @@ -537,7 +537,7 @@ _dbusmenu_server_get_children (DbusmenuServer * server, guint id, GPtrArray * pr } static gboolean -_dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, GError ** error) +_dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GValue * data, guint timestamp, GError ** error) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); @@ -553,7 +553,7 @@ _dbusmenu_server_event (DbusmenuServer * server, guint id, gchar * eventid, GVal return FALSE; } - dbusmenu_menuitem_activate(mi); + dbusmenu_menuitem_activate(mi, timestamp); return TRUE; } |