aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-01-24 07:38:28 -0600
committerTed Gould <ted@gould.cx>2012-01-24 07:38:28 -0600
commit8d18657e839ba4cf8db7b69753a7896bbef49089 (patch)
tree2b325e424d306fc6555e6dae42ea2599fbefafe9
parent1da8653f7745fd81acd89ab6422160235264be81 (diff)
parent0845cb4986d649c38e7f9b9784af76539bfb2dea (diff)
downloadlibdbusmenu-8d18657e839ba4cf8db7b69753a7896bbef49089.tar.gz
libdbusmenu-8d18657e839ba4cf8db7b69753a7896bbef49089.tar.bz2
libdbusmenu-8d18657e839ba4cf8db7b69753a7896bbef49089.zip
Update to trunk
-rw-r--r--Makefile.am.enum2
-rw-r--r--configure.ac6
-rw-r--r--libdbusmenu-glib/Makefile.am23
-rw-r--r--libdbusmenu-glib/client.c2
-rw-r--r--libdbusmenu-gtk/client.c31
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c1
-rw-r--r--libdbusmenu-gtk/parser.c9
-rw-r--r--tests/Makefile.am3
8 files changed, 54 insertions, 23 deletions
diff --git a/Makefile.am.enum b/Makefile.am.enum
index 0503de0..a85061a 100644
--- a/Makefile.am.enum
+++ b/Makefile.am.enum
@@ -35,7 +35,7 @@ stamp-enum-types: $(glib_enum_headers)
$(glib_enum_h): stamp-enum-types
@true
-$(glib_enum_c): $(glib_enum_h)
+$(glib_enum_c): $(builddir)/$(glib_enum_h)
$(QUIET_GEN)mkdir -p `dirname $(builddir)/$(glib_enum_c)`
$(QUIET_GEN)$(GLIB_MKENUMS) \
--template $(srcdir)/$(enum_tmpl_c) \
diff --git a/configure.ac b/configure.ac
index f195f47..ba5cd4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(libdbusmenu, 0.5.0, ted@canonical.com)
+AC_INIT(libdbusmenu, 0.5.1, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.62)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.5.0, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.5.1, [-Wno-portability])
AM_MAINTAINER_MODE
@@ -172,7 +172,7 @@ AC_PATH_PROG([XSLT_PROC], [xsltproc])
###########################
LIBDBUSMENU_CURRENT=4
-LIBDBUSMENU_REVISION=5
+LIBDBUSMENU_REVISION=6
LIBDBUSMENU_AGE=0
AC_SUBST(LIBDBUSMENU_CURRENT)
diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am
index 7d4ea5d..591bf30 100644
--- a/libdbusmenu-glib/Makefile.am
+++ b/libdbusmenu-glib/Makefile.am
@@ -19,7 +19,6 @@ libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-glib/
EXPORTED_OBJECTS = \
- enum-types.h \
menuitem.h \
menuitem-proxy.h \
server.h \
@@ -27,6 +26,7 @@ EXPORTED_OBJECTS = \
libdbusmenu_glibinclude_HEADERS = \
$(EXPORTED_OBJECTS) \
+ enum-types.h \
dbusmenu-glib.h \
types.h
@@ -70,9 +70,16 @@ libdbusmenu_glib_la_LIBADD = \
pkgconfig_DATA = dbusmenu-glib-0.4.pc
pkgconfigdir = $(libdir)/pkgconfig
+ENUMHEADERS = \
+ menuitem.h \
+ menuitem-proxy.h \
+ server.h \
+ client.h \
+ types.h
+
glib_enum_h = enum-types.h
glib_enum_c = enum-types.c
-glib_enum_headers = $(addprefix $(srcdir)/, $(libdbusmenu_glibinclude_HEADERS))
+glib_enum_headers = $(addprefix $(srcdir)/, $(ENUMHEADERS))
DISTCLEANFILES += \
enum-types.c \
@@ -158,16 +165,22 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
if HAVE_INTROSPECTION
+introspection_objects = \
+ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+ $(builddir)/enum-types.h
+
introspection_sources = \
- $(libdbusmenu_glibinclude_HEADERS) \
- $(EXPORTED_OBJECTS:.h=.c)
+ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+ $(srcdir)/dbusmenu-glib.h \
+ $(srcdir)/types.h \
+ $(introspection_objects:.h=.c)
Dbusmenu-0.4.gir: libdbusmenu-glib.la
Dbusmenu_0_4_gir_INCLUDES = \
GObject-2.0
Dbusmenu_0_4_gir_CFLAGS = $(DBUSMENUGLIB_CFLAGS) -I$(top_srcdir)
Dbusmenu_0_4_gir_LIBS = libdbusmenu-glib.la
-Dbusmenu_0_4_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
+Dbusmenu_0_4_gir_FILES = $(introspection_sources)
Dbusmenu_0_4_gir_NAMESPACE = Dbusmenu
Dbusmenu_0_4_gir_VERSION = 0.4
Dbusmenu_0_4_gir_EXPORT_PACKAGES = dbusmenu-glib-0.4
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index a7f4da5..9129db5 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1610,7 +1610,7 @@ void
dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)(gpointer data), gpointer cb_data)
{
g_return_if_fail(DBUSMENU_CLIENT(client));
- g_return_if_fail(id > 0);
+ g_return_if_fail(id >= 0);
DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
g_return_if_fail(priv != NULL);
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index 1051f20..533764a 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -505,7 +505,6 @@ menu_item_stop_activating(DbusmenuMenuitem * mi)
guint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(parent),
data_idle_close_id));
if (id > 0) {
- g_source_remove(id);
g_object_set_data(G_OBJECT(parent), data_idle_close_id,
GINT_TO_POINTER(0));
should_close = TRUE;
@@ -575,6 +574,14 @@ close_in_idle (DbusmenuMenuitem * mi)
}
static void
+cancel_idle_close_id (gpointer data)
+{
+ guint id = GPOINTER_TO_INT(data);
+ if (id > 0)
+ g_source_remove(id);
+}
+
+static void
submenu_notify_visible_cb (GtkWidget * menu, GParamSpec * pspec, DbusmenuMenuitem * mi)
{
if (gtk_widget_get_visible (menu)) {
@@ -591,8 +598,8 @@ submenu_notify_visible_cb (GtkWidget * menu, GParamSpec * pspec, DbusmenuMenuite
data_idle_close_id));
if (id == 0) {
id = g_idle_add((GSourceFunc)close_in_idle, mi);
- g_object_set_data(G_OBJECT(mi), data_idle_close_id,
- GINT_TO_POINTER(id));
+ g_object_set_data_full(G_OBJECT(mi), data_idle_close_id,
+ GINT_TO_POINTER(id), cancel_idle_close_id);
}
}
}
@@ -823,14 +830,22 @@ item_activate (DbusmenuClient * client, DbusmenuMenuitem * mi, guint timestamp,
return;
}
-#ifdef MASSIVEDEBUGGING
static void
-destroy_gmi (GtkMenuItem * gmi, DbusmenuMenuitem * mi)
+destroy_gmi (GtkMenuItem * gmi)
{
- g_debug("Destorying GTK Menuitem for %d", dbusmenu_menuitem_get_id(mi));
+#ifdef MASSIVEDEBUGGING
+ g_debug("Destroying GTK Menuitem %d", gmi);
+#endif
+
+ /* Call gtk_widget_destroy to remove from any containers and cleanup */
+ gtk_widget_destroy(GTK_WIDGET(gmi));
+
+ /* Now remove last ref that we are holding (due to g_object_ref_sink in
+ dbusmenu_gtkclient_newitem_base). This should finalize the object */
+ g_object_unref(G_OBJECT(gmi));
+
return;
}
-#endif
/**
* dbusmenu_gtkclient_newitem_base:
@@ -857,7 +872,7 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem *
/* Attach these two */
g_object_ref_sink(G_OBJECT(gmi));
- g_object_set_data_full(G_OBJECT(item), data_menuitem, gmi, (GDestroyNotify)gtk_widget_destroy);
+ g_object_set_data_full(G_OBJECT(item), data_menuitem, gmi, (GDestroyNotify)destroy_gmi);
/* DbusmenuMenuitem signals */
g_signal_connect(G_OBJECT(item), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(menu_prop_change_cb), client);
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index 5488f93..ef77a2e 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -449,6 +449,7 @@ genericmenuitem_set_image (Genericmenuitem * menu_item, GtkWidget * image)
if (GTK_IS_IMAGE(child)) {
/* We've got a label, let's update it. */
imagew = GTK_IMAGE(child);
+ child = NULL;
} else if (GTK_IS_BOX(child)) {
/* Look for the label in the box */
gtk_container_foreach(GTK_CONTAINER(child), set_image_helper, &imagew);
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index e988c62..92932c5 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -1059,8 +1059,13 @@ widget_notify_cb (GtkWidget *widget,
DBUSMENU_MENUITEM_PROP_VISIBLE,
g_value_get_boolean (&prop_value));
}
- else if (pspec->name == g_intern_static_string ("image") ||
- pspec->name == g_intern_static_string ("always-show-image"))
+ else if (pspec->name == g_intern_static_string ("always-show-image"))
+ {
+ GtkWidget *image = NULL;
+ g_object_get(widget, "image", &image, NULL);
+ update_icon (child, GTK_IMAGE(image));
+ }
+ else if (pspec->name == g_intern_static_string ("image"))
{
GtkWidget *image;
image = GTK_WIDGET (g_value_get_object (&prop_value));
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a4e8682..935e0f9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,9 +29,6 @@ TESTS += \
test-gtk-parser-test
endif
-XFAIL_TESTS = \
- test-glib-proxy
-
# The Python test only work on the system copy of
# dbusmenu, so while they can be usefule they're not
# good tests of what you're currently building. Handy