aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog72
-rwxr-xr-xconfigure22
-rw-r--r--configure.ac6
-rw-r--r--debian/changelog21
-rw-r--r--docs/libdbusmenu-glib/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-glib/reference/version.xml2
-rw-r--r--docs/libdbusmenu-gtk/reference/html/ch01.html2
-rw-r--r--docs/libdbusmenu-gtk/reference/version.xml2
-rw-r--r--libdbusmenu-glib/client.c9
-rw-r--r--libdbusmenu-glib/menuitem.c2
-rw-r--r--libdbusmenu-gtk/Makefile.in2
-rw-r--r--libdbusmenu-gtk/client.c54
12 files changed, 151 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index 2564e02..222ade1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,77 @@
# Generated by Makefile. Do not edit.
+2011-04-07 Ted Gould <ted@gould.cx>
+
+ 0.4.2
+
+2011-04-07 Ted Gould <ted@gould.cx>
+
+ Build menus based on teh child-display property
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Make check to send about-to-show look for properties as well.
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Attching a bug number
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Making the debug message better
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ We don't need the parent, cut-and-paste confusion here.
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Handle the case of the variant being NULL
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Now that we're using the child-display variable more, let's grab it in the first pass.
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Then menu should get created when processing the property, so let's warn and exit here if it's not available
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Passing in the client so that I can get the menuitem in all cases
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Setting up the shell to handle the children display prop
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Add a handler for the open/close events and pass them up to GTK
+
+2011-04-05 Michael Terry <mike@mterry.name>
+
+ respond to opened and closed events for the benefit of any watching application
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Keep refs to the client and makes sure to disconnect all handlers.
+
+2011-04-05 Michael Terry <mike@mterry.name>
+
+ fix typo
+
+2011-04-05 Michael Terry <mike@mterry.name>
+
+ be a little more careful with asynchronous callbacks
+
+2011-04-05 Ted Gould <ted@gould.cx>
+
+ Don't duplicate flags
+
+2011-04-04 Ted Gould <ted@gould.cx>
+
+ Don't need SCANNERFLAGS and INTROSPECTION_SCANNER_ARGS both so they dup'd the parameters.
+
2011-03-31 Ted Gould <ted@gould.cx>
0.4.1
diff --git a/configure b/configure
index b3c6de7..a07335a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.1.
+# Generated by GNU Autoconf 2.67 for libdbusmenu 0.4.2.
#
# Report bugs to <ted@canonical.com>.
#
@@ -703,8 +703,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libdbusmenu'
PACKAGE_TARNAME='libdbusmenu'
-PACKAGE_VERSION='0.4.1'
-PACKAGE_STRING='libdbusmenu 0.4.1'
+PACKAGE_VERSION='0.4.2'
+PACKAGE_STRING='libdbusmenu 0.4.2'
PACKAGE_BUGREPORT='ted@canonical.com'
PACKAGE_URL=''
@@ -1541,7 +1541,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdbusmenu 0.4.1 to adapt to many kinds of systems.
+\`configure' configures libdbusmenu 0.4.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1611,7 +1611,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdbusmenu 0.4.1:";;
+ short | recursive ) echo "Configuration of libdbusmenu 0.4.2:";;
esac
cat <<\_ACEOF
@@ -1751,7 +1751,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libdbusmenu configure 0.4.1
+libdbusmenu configure 0.4.2
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2122,7 +2122,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdbusmenu $as_me 0.4.1, which was
+It was created by libdbusmenu $as_me 0.4.2, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -2943,7 +2943,7 @@ fi
# Define the identity of the package.
PACKAGE=libdbusmenu
- VERSION=0.4.1
+ VERSION=0.4.2
# Some tools Automake needs.
@@ -13294,7 +13294,7 @@ fi
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=12
+LIBDBUSMENU_REVISION=13
LIBDBUSMENU_AGE=0
@@ -14616,7 +14616,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libdbusmenu $as_me 0.4.1, which was
+This file was extended by libdbusmenu $as_me 0.4.2, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14682,7 +14682,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libdbusmenu config.status 0.4.1
+libdbusmenu config.status 0.4.2
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e94e795..0618dd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(libdbusmenu, 0.4.1, ted@canonical.com)
+AC_INIT(libdbusmenu, 0.4.2, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.62)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.4.1, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.4.2, [-Wno-portability])
AM_MAINTAINER_MODE
@@ -134,7 +134,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc])
###########################
LIBDBUSMENU_CURRENT=3
-LIBDBUSMENU_REVISION=12
+LIBDBUSMENU_REVISION=13
LIBDBUSMENU_AGE=0
AC_SUBST(LIBDBUSMENU_CURRENT)
diff --git a/debian/changelog b/debian/changelog
index 6ed6fe8..d17db9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,16 @@
-libdbusmenu (0.4.1-0ubuntu2~ppa1) natty; urgency=low
+libdbusmenu (0.4.2-0ubuntu1~ppa1) UNRELEASED; urgency=low
- * Upstream Merge
- * Fix GIR scan to not include duplicate namespaces (LP: #750575)
- * Keep refs to the client and makes sure to disconnect all
- handlers. (LP: #749609)
- * Add GTK side handlers for the open/close events to ensure GTK
- apps can use those events still (LP: #750588)
-
- -- Ted Gould <ted@ubuntu.com> Tue, 05 Apr 2011 16:29:01 -0500
+ * New upstream release.
+ ∘ Fix GIR scan to not include duplicate namespaces (LP: #750575)
+ ∘ Keep refs to the client and makes sure to disconnect all handlers.
+ (LP: #749609)
+ ∘ Add GTK side handlers for the open/close events to ensure GTK apps
+ can use those events still (LP: #750588)
+ ∘ Create submenus for menuitems that don't have children but still
+ have told us they need them with the child-display property.
+ (LP: #619811)
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 07 Apr 2011 10:24:37 -0500
libdbusmenu (0.4.1-0ubuntu1) natty; urgency=low
diff --git a/docs/libdbusmenu-glib/reference/html/ch01.html b/docs/libdbusmenu-glib/reference/html/ch01.html
index 8aa2186..0cbf2fa 100644
--- a/docs/libdbusmenu-glib/reference/html/ch01.html
+++ b/docs/libdbusmenu-glib/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id471000"></a>API</h2></div></div></div>
+<a name="id552681"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-glib-DbusmenuServer.html">DbusmenuServer</a></span><span class="refpurpose"> — The server signals changed and
diff --git a/docs/libdbusmenu-glib/reference/version.xml b/docs/libdbusmenu-glib/reference/version.xml
index 267577d..2b7c5ae 100644
--- a/docs/libdbusmenu-glib/reference/version.xml
+++ b/docs/libdbusmenu-glib/reference/version.xml
@@ -1 +1 @@
-0.4.1
+0.4.2
diff --git a/docs/libdbusmenu-gtk/reference/html/ch01.html b/docs/libdbusmenu-gtk/reference/html/ch01.html
index 67f02ef..0cf9820 100644
--- a/docs/libdbusmenu-gtk/reference/html/ch01.html
+++ b/docs/libdbusmenu-gtk/reference/html/ch01.html
@@ -21,7 +21,7 @@
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
-<a name="id520868"></a>API</h2></div></div></div>
+<a name="id463422"></a>API</h2></div></div></div>
<div class="toc"><dl>
<dt>
<span class="refentrytitle"><a href="libdbusmenu-gtk-DbusmenuGtkMenu.html">DbusmenuGtkMenu</a></span><span class="refpurpose"> — A GTK Menu Object that syncronizes over DBus</span>
diff --git a/docs/libdbusmenu-gtk/reference/version.xml b/docs/libdbusmenu-gtk/reference/version.xml
index 267577d..2b7c5ae 100644
--- a/docs/libdbusmenu-gtk/reference/version.xml
+++ b/docs/libdbusmenu-gtk/reference/version.xml
@@ -1 +1 @@
-0.4.1
+0.4.2
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 1378e21..45cf0d1 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -331,6 +331,8 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass)
return;
}
+#define LAYOUT_PROPS_COUNT 5
+
static void
dbusmenu_client_init (DbusmenuClient *self)
{
@@ -351,13 +353,14 @@ dbusmenu_client_init (DbusmenuClient *self)
priv->layoutcall = NULL;
- gchar * layout_props[5];
+ gchar * layout_props[LAYOUT_PROPS_COUNT + 1];
layout_props[0] = DBUSMENU_MENUITEM_PROP_TYPE;
layout_props[1] = DBUSMENU_MENUITEM_PROP_LABEL;
layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;
layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;
- layout_props[4] = NULL;
- priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, 4);
+ layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;
+ layout_props[LAYOUT_PROPS_COUNT] = NULL;
+ priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);
g_variant_ref_sink(priv->layout_props);
priv->current_revision = 0;
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 70b5fd2..bdaf49f 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -446,7 +446,7 @@ send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gp
{
g_return_if_fail(DBUSMENU_IS_MENUITEM(mi));
- if (dbusmenu_menuitem_get_children(mi) == NULL) {
+ if (dbusmenu_menuitem_get_children(mi) == NULL && g_strcmp0(DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU, dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) != 0) {
g_warning("About to Show called on an item wihtout submenus. We're ignoring it.");
} else {
gboolean dummy;
diff --git a/libdbusmenu-gtk/Makefile.in b/libdbusmenu-gtk/Makefile.in
index 5647d0d..465ee0b 100644
--- a/libdbusmenu-gtk/Makefile.in
+++ b/libdbusmenu-gtk/Makefile.in
@@ -401,7 +401,6 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) --includedir=$(top_buildd
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk_0_4_gir_LIBS = libdbusmenu-gtk$(VER).la
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk_0_4_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk_0_4_gir_NAMESPACE = DbusmenuGtk$(VER)
-@HAVE_INTROSPECTION_TRUE@DbusmenuGtk_0_4_gir_SCANNERFLAGS = $(INTROSPECTION_SCANNER_ARGS)
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk_0_4_gir_EXPORT_PACKAGES = dbusmenu-gtk$(VER)-0.4
# We duplicate these for the same reason as libdbusmenu_gtk3includedir above
@@ -410,7 +409,6 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) --includedir=$(top_buildd
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk3_0_4_gir_LIBS = $(DbusmenuGtk_0_4_gir_LIBS)
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk3_0_4_gir_FILES = $(DbusmenuGtk_0_4_gir_FILES)
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk3_0_4_gir_NAMESPACE = $(DbusmenuGtk_0_4_gir_NAMESPACE)
-@HAVE_INTROSPECTION_TRUE@DbusmenuGtk3_0_4_gir_SCANNERFLAGS = $(DbusmenuGtk_0_4_gir_SCANNERFLAGS)
@HAVE_INTROSPECTION_TRUE@DbusmenuGtk3_0_4_gir_EXPORT_PACKAGES = $(DbusmenuGtk_0_4_gir_EXPORT_PACKAGES)
@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0
@HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS)
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 497808b..7f05d46 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -551,11 +551,43 @@ process_toggle_state (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * varia
return;
}
+/* Submenu processing */
+static void
+process_submenu (DbusmenuMenuitem * mi, GtkMenuItem * gmi, GVariant * variant, DbusmenuGtkClient * gtkclient)
+{
+ const gchar * submenu = NULL;
+ if (variant != NULL) {
+ submenu = g_variant_get_string(variant, NULL);
+ }
+
+ if (g_strcmp0(submenu, DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU) != 0) {
+ /* This is the only case we're really supporting right now,
+ so if it's not this, we want to clean up. */
+ /* We're just going to warn for now. */
+ gpointer pmenu = g_object_get_data(G_OBJECT(mi), data_menu);
+ if (pmenu != NULL) {
+ g_warning("The child-display variable is set to '%s' but there's a menu, odd?", submenu);
+ }
+ } else {
+ /* We need to build a menu for these guys to live in. */
+ GtkMenu * menu = GTK_MENU(gtk_menu_new());
+ g_object_set_data(G_OBJECT(mi), data_menu, menu);
+
+ gtk_menu_item_set_submenu(gmi, GTK_WIDGET(menu));
+
+ g_signal_connect(menu, "notify::visible", G_CALLBACK(submenu_notify_visible_cb), mi);
+ }
+
+ return;
+}
+
/* Whenever we have a property change on a DbusmenuMenuitem
we need to be responsive to that. */
static void
-menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, GtkMenuItem * gmi)
+menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, DbusmenuGtkClient * gtkclient)
{
+ GtkMenuItem * gmi = dbusmenu_gtkclient_menuitem_get(gtkclient, mi);
+
if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_LABEL)) {
gtk_menu_item_set_label(gmi, variant == NULL ? NULL : g_variant_get_string(variant, NULL));
} else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_VISIBLE)) {
@@ -566,6 +598,8 @@ menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, Gt
process_toggle_type(mi, gmi, variant);
} else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)) {
process_toggle_state(mi, gmi, variant);
+ } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY)) {
+ process_submenu(mi, gmi, variant, gtkclient);
}
return;
@@ -704,7 +738,7 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
#endif
/* DbusmenuMenuitem signals */
- g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), gmi);
+ g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), client);
g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_shortcut_change_cb), client);
g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(delete_child), client);
g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(move_child), client);
@@ -720,6 +754,7 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
process_sensitive(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ENABLED));
process_toggle_type(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE));
process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));
+ process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client);
refresh_shortcut(client, item);
/* Oh, we're a child, let's deal with that */
@@ -741,17 +776,12 @@ new_child (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position, Dbus
if (g_strcmp0(dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_TYPE), DBUSMENU_CLIENT_TYPES_SEPARATOR) == 0) { return; }
gpointer ann_menu = g_object_get_data(G_OBJECT(mi), data_menu);
- GtkMenu * menu = GTK_MENU(ann_menu);
- if (menu == NULL) {
- /* Oh, we don't have a submenu, build one! */
- menu = GTK_MENU(gtk_menu_new());
- g_object_set_data(G_OBJECT(mi), data_menu, menu);
-
- GtkMenuItem * parent = dbusmenu_gtkclient_menuitem_get(gtkclient, mi);
- gtk_menu_item_set_submenu(parent, GTK_WIDGET(menu));
+ if (ann_menu == NULL) {
+ g_warning("Children but no menu, someone's been naughty with their '" DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "' property: '%s'", dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY));
+ return;
+ }
- g_signal_connect(menu, "notify::visible", G_CALLBACK(submenu_notify_visible_cb), mi);
- }
+ GtkMenu * menu = GTK_MENU(ann_menu);
GtkMenuItem * childmi = dbusmenu_gtkclient_menuitem_get(gtkclient, child);
gtk_menu_shell_insert(GTK_MENU_SHELL(menu), GTK_WIDGET(childmi), position);