aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-31 13:51:48 -0500
committerTed Gould <ted@gould.cx>2010-03-31 13:51:48 -0500
commit0bec1d5af5d3d61ffc24913e0257f724765e5563 (patch)
treee6aaa5fd904fbb136625714c1643381b5baa26ce
parent79f8505edd8fd05373275f2835e2400d7611fcf5 (diff)
parent04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68 (diff)
downloadlibdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.tar.gz
libdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.tar.bz2
libdbusmenu-0bec1d5af5d3d61ffc24913e0257f724765e5563.zip
Bringing up to date with trunk
-rw-r--r--configure.ac6
-rw-r--r--libdbusmenu-glib/client.c16
-rw-r--r--libdbusmenu-glib/menuitem.c2
-rw-r--r--libdbusmenu-glib/menuitem.h2
-rw-r--r--libdbusmenu-gtk/client.c13
-rw-r--r--tests/test-gtk-label.json4
6 files changed, 33 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index d34f32e..7f6c776 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
-AC_INIT(libdbusmenu, 0.2.6, ted@canonical.com)
+AC_INIT(libdbusmenu, 0.2.8, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])
AC_PREREQ(2.62)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.2.6, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.2.8, [-Wno-portability])
AM_MAINTAINER_MODE
@@ -78,7 +78,7 @@ AC_PATH_PROG([VALA_API_GEN], [vapigen])
###########################
LIBDBUSMENU_CURRENT=1
-LIBDBUSMENU_REVISION=4
+LIBDBUSMENU_REVISION=5
LIBDBUSMENU_AGE=0
AC_SUBST(LIBDBUSMENU_CURRENT)
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index ef0205f..09a663a 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -337,7 +337,12 @@ id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, D
g_return_if_fail(priv->root != NULL);
DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);
- g_return_if_fail(menuitem != NULL);
+ if (menuitem == NULL) {
+ #ifdef MASSIVEDEBUGGING
+ g_debug("Property update '%s' on id %d which couldn't be found", property, id);
+ #endif
+ return;
+ }
dbusmenu_menuitem_property_set_value(menuitem, property, value);
@@ -444,6 +449,9 @@ proxy_destroyed (GObject * gobj_proxy, gpointer userdata)
priv->layoutcall = NULL;
}
+ priv->current_revision = 0;
+ priv->my_revision = 0;
+
build_dbus_proxy(DBUSMENU_CLIENT(userdata));
return;
}
@@ -848,13 +856,17 @@ parse_layout (DbusmenuClient * client, const gchar * layout)
clean up that old root */
if (oldroot != NULL) {
dbusmenu_menuitem_set_root(oldroot, FALSE);
- g_object_unref(oldroot);
}
/* If the root changed we can signal that */
g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE);
}
+ /* We need to unref it in this function no matter */
+ if (oldroot != NULL) {
+ g_object_unref(oldroot);
+ }
+
return 1;
}
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 0186a20..fce8ed5 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -459,7 +459,7 @@ take_children_signal (gpointer data, gpointer user_data)
While the name sounds devious that's exactly what this function
does. It takes the list of children from the @mi and clears the
- internal list. The calling function is no in charge of the ref's
+ internal list. The calling function is now in charge of the ref's
on the children it has taken. A lot of responsibility involved
in taking children.
diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h
index 0183254..cb6b8f4 100644
--- a/libdbusmenu-glib/menuitem.h
+++ b/libdbusmenu-glib/menuitem.h
@@ -66,6 +66,8 @@ G_BEGIN_DECLS
#define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED 1
#define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1
+#define DBUSMENU_MENUITEM_ICON_NAME_BLANK "blank-icon"
+
/**
DbusmenuMenuitem:
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index bef27dd..3de42fe 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -417,7 +417,6 @@ dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem *
gpointer data = g_object_get_data(G_OBJECT(item), data_menuitem);
if (data == NULL) {
- g_warning("GTK not updated");
return NULL;
}
@@ -519,7 +518,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV
if (!g_strcmp0(property, DBUSMENU_MENUITEM_PROP_ICON_DATA)) {
/* If we have an image already built from a name that is
way better than a pixbuf. Keep it. */
- if (gtkimage != NULL && gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME) {
+ if (gtkimage != NULL && (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME || gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_EMPTY)) {
return;
}
}
@@ -531,6 +530,8 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV
/* If there is no name, by golly we want no
icon either. */
gtkimage = NULL;
+ } else if (g_strcmp0(iconname, DBUSMENU_MENUITEM_ICON_NAME_BLANK) == 0) {
+ gtkimage = gtk_image_new();
} else {
/* Look to see if we want to have an icon with the 'ltr' or
'rtl' depending on what we're doing. */
@@ -590,6 +591,14 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV
}
+ if (gtkimage != NULL) {
+ gint width, height;
+ gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
+
+ gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height);
+ gtk_misc_set_alignment(GTK_MISC(gtkimage), 0.0, 0.5);
+ }
+
genericmenuitem_set_image(GENERICMENUITEM(gimi), gtkimage);
return;
diff --git a/tests/test-gtk-label.json b/tests/test-gtk-label.json
index 973ab7b..755bd44 100644
--- a/tests/test-gtk-label.json
+++ b/tests/test-gtk-label.json
@@ -242,8 +242,8 @@
"label": "sad"},
{"id": 89,
"type": "standard",
- "icon-name": "face-sick",
- "label": "sick"}
+ "icon-name": "blank-icon",
+ "label": "blank"}
]
},
{"id": 9, "type": "standard",