From d177c5f4692279198a2ff4b7e21e92208a69075b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 17 Sep 2010 16:33:38 -0500 Subject: Turn about to show into an activate for those with children. --- libdbusmenu-glib/menuitem.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index ea69776..fb12163 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -97,6 +97,7 @@ static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * static void g_value_transform_STRING_BOOLEAN (const GValue * in, GValue * out); static void g_value_transform_STRING_INT (const GValue * in, GValue * out); static void handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp); +static void send_about_to_show (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data); /* GObject stuff */ G_DEFINE_TYPE (DbusmenuMenuitem, dbusmenu_menuitem, G_TYPE_OBJECT); @@ -114,6 +115,7 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) object_class->get_property = get_property; klass->handle_event = handle_event; + klass->send_about_to_show = send_about_to_show; /** DbusmenuMenuitem::property-changed: @@ -387,6 +389,28 @@ handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, g return; } +/* Handles our about to show signal on items that submenus + exist. This is sending just activate now, but we should + probably consider a special signal in the future if GTK + gets more sophisticated about this. */ +static void +send_about_to_show (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data) +{ + g_return_if_fail(DBUSMENU_IS_MENUITEM(mi)); + + if (dbusmenu_menuitem_get_children(mi) == NULL) { + g_warning("About to Show called on an item wihtout submenus. We're ignoring it."); + } else { + g_signal_emit(G_OBJECT(mi), signals[ITEM_ACTIVATED], 0, 0 /* timestamp */, TRUE); + } + + if (cb != NULL) { + cb(mi, cb_data); + } + + return; +} + /* Public interface */ /** -- cgit v1.2.3 From f561d3f108970043aaeac0377e69453e3c6173d4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 19 Sep 2010 14:38:55 -0500 Subject: releasing version 0.3.14-0ubuntu1~ppa2~ats1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2014451..b6c8cb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.3.14-0ubuntu1~ppa2~ats1) UNRELEASED; urgency=low +libdbusmenu (0.3.14-0ubuntu1~ppa2~ats1) maverick; urgency=low * Upstream Merge * Passing up About-to-show as an activate signal - -- Ted Gould Sun, 19 Sep 2010 14:27:38 -0500 + -- Ted Gould Sun, 19 Sep 2010 14:38:52 -0500 libdbusmenu (0.3.14-0ubuntu1~ppa1) maverick; urgency=low -- cgit v1.2.3