From 9206192fdffc7a3db5dadb0c50ecb8883fd23b8e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 4 Mar 2010 11:10:22 -0600 Subject: 0.2.7 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d34f32e..f391354 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.7, 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.7, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3 From ffe464a75f028d5efb8be49d03bd60c8dd176970 Mon Sep 17 00:00:00 2001 From: Kalle Valo Date: Wed, 10 Mar 2010 09:00:02 +0200 Subject: Fix a typo in dbusmenu_menuitem_take_children() documentation. It wasn't fully clear if the "no" was actually "now" or "not", but based on the code I assume that it should be "now". --- libdbusmenu-glib/menuitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index a2d2682..28d3134 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. -- cgit v1.2.3 From 6eef17fbf0844823f52d6971c5f597e366d6f24e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Mar 2010 00:01:40 -0500 Subject: Adding a define to provide a blank icon in the icon name --- libdbusmenu-glib/menuitem.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 1382335..04fd911 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: -- cgit v1.2.3 From e6a3a5a5c120082af8f45471646498d1ed957aa2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Mar 2010 00:06:21 -0500 Subject: Check to see if we sent the blank icon, and space appropriately. --- libdbusmenu-gtk/client.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 781326e..13a7499 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -525,6 +525,16 @@ 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) { + if (gtkimage != NULL) { + g_object_unref(gtkimage); + } + + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + + gtkimage = gtk_image_new(); + gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height); } else { /* Look to see if we want to have an icon with the 'ltr' or 'rtl' depending on what we're doing. */ -- cgit v1.2.3 From 7f482a71845029ea5bdb865b1acf6736315ca511 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Mar 2010 00:09:14 -0500 Subject: Adding a blank item test, replacing sick. Bad icon. --- tests/test-gtk-label.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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", -- cgit v1.2.3 From c73fc61a3c5d997a21065c6269495e393d9e7bbe Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Mar 2010 00:32:53 -0500 Subject: Add alignment settings to the icons --- libdbusmenu-gtk/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 13a7499..8483675 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -594,6 +594,10 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV } + if (gtkimage != NULL) { + gtk_misc_set_alignment(GTK_MISC(gtkimage), 0.0, 0.5); + } + genericmenuitem_set_image(GENERICMENUITEM(gimi), gtkimage); return; -- cgit v1.2.3 From 9cd65dfe04e12dc665f3a0baee9c816ffddbeb54 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Tue, 23 Mar 2010 20:03:06 -0500 Subject: Remove warning --- libdbusmenu-gtk/client.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 781326e..bc97b97 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -411,7 +411,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; } -- cgit v1.2.3 From 9855cec4e4cbc745fdafb6270975be7f3e4f99fc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Mar 2010 23:14:57 -0500 Subject: This is crazy --- libdbusmenu-gtk/client.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 8483675..dfa2fe2 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -533,7 +533,32 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); +#if 0 + /* Not work */ + GError * error = NULL; + GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file("/usr/share/icons/hicolor/16x16/apps/wine.png", &error); + if (error != NULL) { g_warning("Blank error: %s", error->message); } + gtkimage = gtk_image_new_from_pixbuf(pixbuf); +#endif +#if 1 + /* Work */ + gtkimage = gtk_image_new_from_icon_name("stock_person", GTK_ICON_SIZE_MENU); +#endif +#if 0 + /* Not Work */ gtkimage = gtk_image_new(); +#endif +#if 0 + /* Not work */ + gtkimage = gtk_image_new_from_icon_name("stock_person", GTK_ICON_SIZE_MENU); + gtk_image_clear(GTK_IMAGE(gtkimage)); +#endif +#if 0 + /* Not work */ + gtkimage = gtk_image_new(); + gtk_widget_show(gtkimage); +#endif + gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height); } else { /* Look to see if we want to have an icon with the 'ltr' or -- cgit v1.2.3 From f43fd84cd34b07a2966f858ca9c68985670fbe82 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 11:05:34 -0500 Subject: Checking for blank icon when we get a pixmap paramater. --- libdbusmenu-gtk/client.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index dfa2fe2..ba01800 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -513,7 +513,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; } } @@ -533,32 +533,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); -#if 0 - /* Not work */ - GError * error = NULL; - GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file("/usr/share/icons/hicolor/16x16/apps/wine.png", &error); - if (error != NULL) { g_warning("Blank error: %s", error->message); } - gtkimage = gtk_image_new_from_pixbuf(pixbuf); -#endif -#if 1 - /* Work */ - gtkimage = gtk_image_new_from_icon_name("stock_person", GTK_ICON_SIZE_MENU); -#endif -#if 0 - /* Not Work */ gtkimage = gtk_image_new(); -#endif -#if 0 - /* Not work */ - gtkimage = gtk_image_new_from_icon_name("stock_person", GTK_ICON_SIZE_MENU); - gtk_image_clear(GTK_IMAGE(gtkimage)); -#endif -#if 0 - /* Not work */ - gtkimage = gtk_image_new(); - gtk_widget_show(gtkimage); -#endif - gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height); } else { /* Look to see if we want to have an icon with the 'ltr' or -- cgit v1.2.3 From d8debfa0837737c6ecc59960197ca59c071ead0b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 11:12:02 -0500 Subject: Moving the requesition to be for all icons. No reason not to just double check. --- libdbusmenu-gtk/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index ba01800..d93bb93 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -530,11 +530,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV g_object_unref(gtkimage); } - gint width, height; - gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); - gtkimage = gtk_image_new(); - gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height); } else { /* Look to see if we want to have an icon with the 'ltr' or 'rtl' depending on what we're doing. */ @@ -595,6 +591,10 @@ 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); } -- cgit v1.2.3 From 9cd59b2659b97e9cb4a8dcbf3e88bcb5713fb721 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 12:33:45 -0500 Subject: We shouldn't need to unref, as we don't have a ref. --- libdbusmenu-gtk/client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index e79d088..98f1cb2 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -525,10 +525,6 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, const GV icon either. */ gtkimage = NULL; } else if (g_strcmp0(iconname, DBUSMENU_MENUITEM_ICON_NAME_BLANK) == 0) { - if (gtkimage != NULL) { - g_object_unref(gtkimage); - } - gtkimage = gtk_image_new(); } else { /* Look to see if we want to have an icon with the 'ltr' or -- cgit v1.2.3 From 63a5d2daa865aa68b4ea152a92373e3c187e13af Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Mar 2010 10:06:58 -0500 Subject: 0.2.8 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f391354..7f6c776 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.2.7, 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.7, [-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) -- cgit v1.2.3 From 4f9bfdd91ad1ebd0fb8d778a717c9429a6c258c2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 31 Mar 2010 00:47:26 -0500 Subject: When the proxies drop, we need to assume we're starting over with revision numbers too. --- libdbusmenu-glib/client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 309a11c..697420f 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -444,6 +444,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; } -- cgit v1.2.3 From 4d34ef26ed23a32ba777d1049a6fa6de88750516 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 31 Mar 2010 01:03:44 -0500 Subject: Removing this error. It's reasonable for this to happen, and the correction is that when we DO get the item, we'll ask for all of it's properties. --- libdbusmenu-glib/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 697420f..ae4b2f9 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); -- cgit v1.2.3 From 69f2190a6e57920e6086013c87cea5cc1734abcb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 31 Mar 2010 08:59:36 -0500 Subject: Unreffing always when updating. --- libdbusmenu-glib/client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index ae4b2f9..fb2a2bc 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -802,13 +802,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; } -- cgit v1.2.3