From 99f3dd583adc89eb13328c8a152790542dd20f07 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 16 Feb 2010 09:59:46 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6144070..b0f12a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.13-0ubuntu3~ppa1) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa1) lucid; urgency=low * Upstream Merge * Submenu support * Updating menus - -- Ted Gould Tue, 16 Feb 2010 09:52:08 -0600 + -- Ted Gould Tue, 16 Feb 2010 09:59:44 -0600 indicator-application (0.0.13-0ubuntu2) lucid; urgency=low -- cgit v1.2.3 From de406e516344899c4006ce989e5915d7e39a1267 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Tue, 16 Feb 2010 10:18:03 -0600 Subject: Check priv->menu for non-NULL --- src/libappindicator/app-indicator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 0324a34..88f6bb6 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -1252,9 +1252,12 @@ setup_dbusmenu (AppIndicator *self) priv = self->priv; root = dbusmenu_menuitem_new (); - gtk_container_forall (GTK_CONTAINER (priv->menu), - container_iterate, - root); + if (priv->menu) + { + gtk_container_forall (GTK_CONTAINER (priv->menu), + container_iterate, + root); + } if (priv->menuservice == NULL) { -- cgit v1.2.3 From 386128abb4ef32983efd13b1e757459aa34d473b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 16 Feb 2010 10:31:32 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4bd0fd0..a206a65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.13-0ubuntu3~ppa2) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa2) lucid; urgency=low * Upstream Merge * Fixing a crash by checking for NULL - -- Ted Gould Tue, 16 Feb 2010 10:29:07 -0600 + -- Ted Gould Tue, 16 Feb 2010 10:31:30 -0600 indicator-application (0.0.13-0ubuntu3~ppa1) lucid; urgency=low -- cgit v1.2.3 From 715d75230d1164601639043303bc869289e7e9ae Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Wed, 17 Feb 2010 16:04:09 -0600 Subject: Disconnect 'client_menu_changed' in dispose method. --- src/libappindicator/app-indicator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 88f6bb6..7fb7996 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -141,6 +141,7 @@ static void status_icon_changes (AppIndicator * self, gpointer data); static void status_icon_activate (GtkStatusIcon * icon, gpointer data); static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); static void watcher_proxy_destroyed (GObject * object, gpointer data); +static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator); /* GObject type */ G_DEFINE_TYPE (AppIndicator, app_indicator, G_TYPE_OBJECT); @@ -364,7 +365,10 @@ app_indicator_dispose (GObject *object) } if (priv->menu != NULL) { - g_object_unref(G_OBJECT(priv->menu)); + g_signal_handlers_disconnect_by_func (G_OBJECT (priv->menu), + client_menu_changed, + self); + g_object_unref(G_OBJECT(priv->menu)); priv->menu = NULL; } -- cgit v1.2.3 From 9012c49ff3299dc4c1b965fc49c3d0638a927846 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Fri, 19 Feb 2010 09:20:34 -0600 Subject: Fix to unregister the object --- src/libappindicator/app-indicator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 7fb7996..c0ccaec 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -598,6 +598,9 @@ check_connect (AppIndicator *self) if (priv->id == NULL) return; gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s", priv->clean_id); + + g_warning ("%s. %s", __FUNCTION__, path); + dbus_g_connection_register_g_object(priv->connection, path, G_OBJECT(self)); @@ -612,6 +615,8 @@ check_connect (AppIndicator *self) /* Unable to get proxy, but we're handling that now so it's not a warning anymore. */ g_error_free(error); + dbus_g_connection_unregister_g_object(priv->connection, + G_OBJECT(self)); start_fallback_timer(self, FALSE); g_free(path); return; @@ -632,6 +637,8 @@ watcher_proxy_destroyed (GObject * object, gpointer data) AppIndicator * self = APP_INDICATOR(data); g_return_if_fail(self != NULL); + dbus_g_connection_unregister_g_object(self->priv->connection, + G_OBJECT(self)); self->priv->watcher_proxy = NULL; start_fallback_timer(self, FALSE); return; @@ -649,6 +656,8 @@ register_service_cb (DBusGProxy * proxy, GError * error, gpointer data) /* They didn't respond, ewww. Not sure what they could be doing */ g_warning("Unable to connect to the Notification Watcher: %s", error->message); + dbus_g_connection_unregister_g_object(priv->connection, + G_OBJECT(data)); g_object_unref(G_OBJECT(priv->watcher_proxy)); priv->watcher_proxy = NULL; start_fallback_timer(APP_INDICATOR(data), TRUE); -- cgit v1.2.3 From b79a5bb8b9f21aedfefeb48429dc62f7f51978b6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 19 Feb 2010 09:21:19 -0600 Subject: Removing debug output --- src/libappindicator/app-indicator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index c0ccaec..027f794 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -599,8 +599,6 @@ check_connect (AppIndicator *self) gchar * path = g_strdup_printf(DEFAULT_ITEM_PATH "/%s", priv->clean_id); - g_warning ("%s. %s", __FUNCTION__, path); - dbus_g_connection_register_g_object(priv->connection, path, G_OBJECT(self)); -- cgit v1.2.3 -- cgit v1.2.3 From 780acae841999f6d3a9c03031daff5783c301750 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 19 Feb 2010 11:02:18 -0600 Subject: Checking for a null string as the attention icon. --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index ec6da50..b189a45 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -397,7 +397,7 @@ apply_status (Application * app, ApplicationStatus status) } else { /* Figure out which icon we should be using */ gchar * newicon = app->icon; - if (status == APP_STATUS_ATTENTION && app->aicon != NULL) { + if (status == APP_STATUS_ATTENTION && app->aicon != NULL && app->aicon[0] != '\0') { newicon = app->aicon; } -- cgit v1.2.3 From e0356204fceabcd64244745f9a671aa3711ec822 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 19 Feb 2010 16:12:56 -0600 Subject: Putting in a mock watcher so we don't fall back. --- tests/test-libappindicator-dbus-client.c | 32 ++++++++++++++++++++++++++++++++ tests/test-libappindicator-dbus-server.c | 1 + 2 files changed, 33 insertions(+) diff --git a/tests/test-libappindicator-dbus-client.c b/tests/test-libappindicator-dbus-client.c index 6125d36..f5482aa 100644 --- a/tests/test-libappindicator-dbus-client.c +++ b/tests/test-libappindicator-dbus-client.c @@ -23,9 +23,13 @@ with this program. If not, see . #include #include +#include +#include #include #include "test-defines.h" +#include "../src/dbus-shared.h" + static GMainLoop * mainloop = NULL; static gboolean passed = TRUE; static int propcount = 0; @@ -184,6 +188,19 @@ kill_func (gpointer userdata) return FALSE; } +static DBusHandlerResult +dbus_filter (DBusConnection * connection, DBusMessage * message, void * user_data) +{ + if (dbus_message_is_method_call(message, NOTIFICATION_WATCHER_DBUS_ADDR, "RegisterStatusNotifierItem")) { + DBusMessage * reply = dbus_message_new_method_return(message); + dbus_connection_send(connection, reply, NULL); + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; + } + + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + gint main (gint argc, gchar * argv[]) { @@ -198,6 +215,21 @@ main (gint argc, gchar * argv[]) return 1; } + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + + dbus_connection_add_filter(dbus_g_connection_get_connection(session_bus), dbus_filter, NULL, NULL); + DBusGProxy * props = dbus_g_proxy_new_for_name_owner(session_bus, ":1.0", "/org/ayatana/NotificationItem/my_id", diff --git a/tests/test-libappindicator-dbus-server.c b/tests/test-libappindicator-dbus-server.c index 76f0e50..2d68950 100644 --- a/tests/test-libappindicator-dbus-server.c +++ b/tests/test-libappindicator-dbus-server.c @@ -44,6 +44,7 @@ main (gint argc, gchar * argv[]) g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL)))); AppIndicator * ci = app_indicator_new (TEST_ID, TEST_ICON_NAME, TEST_CATEGORY); + app_indicator_set_status (ci, TEST_STATE); app_indicator_set_attention_icon (ci, TEST_ATTENTION_ICON_NAME); -- cgit v1.2.3 From 7e683f7476324dd4490a6b6ec0dbd27fcd47c4da Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 19 Feb 2010 16:18:51 -0600 Subject: Adding a mock server here as well --- tests/test-libappindicator-status-client.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/test-libappindicator-status-client.c b/tests/test-libappindicator-status-client.c index 55d85a2..acf4fca 100644 --- a/tests/test-libappindicator-status-client.c +++ b/tests/test-libappindicator-status-client.c @@ -23,6 +23,7 @@ with this program. If not, see . #include #include +#include #include #include "../src/dbus-shared.h" @@ -36,6 +37,20 @@ static guint toggle_count = 0; #define ACTIVE_STR "Active" #define ATTN_STR "NeedsAttention" +static DBusHandlerResult +dbus_reg_filter (DBusConnection * connection, DBusMessage * message, void * user_data) +{ + if (dbus_message_is_method_call(message, NOTIFICATION_WATCHER_DBUS_ADDR, "RegisterStatusNotifierItem")) { + DBusMessage * reply = dbus_message_new_method_return(message); + dbus_connection_send(connection, reply, NULL); + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; + } + + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + + static DBusHandlerResult dbus_filter (DBusConnection * connection, DBusMessage * message, void * user_data) { @@ -103,6 +118,21 @@ main (gint argc, gchar * argv[]) return 1; } + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + + dbus_connection_add_filter(dbus_g_connection_get_connection(session_bus), dbus_reg_filter, NULL, NULL); + dbus_connection_add_filter(dbus_g_connection_get_connection(session_bus), dbus_filter, NULL, NULL); dbus_bus_add_match(dbus_g_connection_get_connection(session_bus), "type='signal',interface='" NOTIFICATION_ITEM_DBUS_IFACE "',member='NewStatus'", NULL); -- cgit v1.2.3 From 271d86bb751d95eb901ca7dc60455cf646b9d74f Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Mon, 22 Feb 2010 09:55:55 -0600 Subject: Set the sensitive state when starting out. --- src/libappindicator/app-indicator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 027f794..62e8905 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -1245,6 +1245,10 @@ container_iterate (GtkWidget *widget, } } + dbusmenu_menuitem_property_set_bool (child, + DBUSMENU_MENUITEM_PROP_ENABLED, + GTK_WIDGET_IS_SENSITIVE (widget)); + g_signal_connect (widget, "notify", G_CALLBACK (widget_notify_cb), child); -- cgit v1.2.3 -- cgit v1.2.3 From a067b5b0e1da84a381eb5ca5a426b87680dcc9f7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 12:54:25 -0600 Subject: Trying to make the test a little more robust by waiting for the other process to register on the bus, and then waiting. --- tests/test-libappindicator-fallback-item.c | 23 +++++++++++++++++++++++ tests/test-libappindicator-fallback-watcher.c | 14 ++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/tests/test-libappindicator-fallback-item.c b/tests/test-libappindicator-fallback-item.c index 2c6e044..9fd1b45 100644 --- a/tests/test-libappindicator-fallback-item.c +++ b/tests/test-libappindicator-fallback-item.c @@ -1,5 +1,7 @@ #include #include +#include +#include #include #define TEST_LIBAPPINDICATOR_FALLBACK_ITEM_TYPE (test_libappindicator_fallback_item_get_type ()) @@ -106,6 +108,27 @@ main (int argc, char ** argv) { gtk_init(&argc, &argv); + GError * error = NULL; + DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (error != NULL) { + g_error("Unable to get session bus: %s", error->message); + return 1; + } + + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, "org.test", 0, &nameret, NULL)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + TestLibappindicatorFallbackItem * item = g_object_new(TEST_LIBAPPINDICATOR_FALLBACK_ITEM_TYPE, "id", "test-id", "category", "Other", diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c index 90c7db8..c632dff 100644 --- a/tests/test-libappindicator-fallback-watcher.c +++ b/tests/test-libappindicator-fallback-watcher.c @@ -56,10 +56,6 @@ main (int argv, char ** argc) g_debug("Waiting to init."); - /* Wait 1/4 a second, which should trigger the fallback */ - g_usleep(250000); - - g_debug("Initing"); GError * error = NULL; DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); @@ -69,6 +65,16 @@ main (int argv, char ** argc) } DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + + gboolean has_owner = FALSE; + while (!has_owner) { + org_freedesktop_DBus_name_has_owner(bus_proxy, "org.test", &has_owner, NULL); + } + + g_usleep(250000); + + g_debug("Initing"); + guint nameret = 0; if (!org_freedesktop_DBus_request_name(bus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, 0, &nameret, &error)) { -- cgit v1.2.3 From bf13c7af125d97c2067da1b365ac4f11c2f2b943 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 12:56:03 -0600 Subject: Fall out of the while, sometime, if we really think it's not recoverable. --- tests/test-libappindicator-fallback-watcher.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c index c632dff..70e01d1 100644 --- a/tests/test-libappindicator-fallback-watcher.c +++ b/tests/test-libappindicator-fallback-watcher.c @@ -67,8 +67,15 @@ main (int argv, char ** argc) DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); gboolean has_owner = FALSE; - while (!has_owner) { + gint owner_count = 0; + while (!has_owner && owner_count < 10000) { org_freedesktop_DBus_name_has_owner(bus_proxy, "org.test", &has_owner, NULL); + owner_count++; + } + + if (owner_count == 10000) { + g_error("Unable to get name owner after 10000 tries"); + return 1; } g_usleep(250000); -- cgit v1.2.3 From 75ccac53fc05f24633c76ac5d956b91a9a6640fb Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Mon, 22 Feb 2010 14:47:03 -0600 Subject: Creates and event handler for the add and remove signals to recreate the menu --- src/libappindicator/app-indicator.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 62e8905..361875d 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -142,6 +142,7 @@ static void status_icon_activate (GtkStatusIcon * icon, gpointer data); static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); static void watcher_proxy_destroyed (GObject * object, gpointer data); static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator); +static void submenu_changed (GtkWidget *widget, GtkWidget *child, gpointer data); /* GObject type */ G_DEFINE_TYPE (AppIndicator, app_indicator, G_TYPE_OBJECT); @@ -1242,6 +1243,16 @@ container_iterate (GtkWidget *widget, gtk_container_forall (GTK_CONTAINER (submenu), container_iterate, child); + g_signal_connect_object (submenu, + "add", + G_CALLBACK (submenu_changed), + child, + 0); + g_signal_connect_object (submenu, + "remove", + G_CALLBACK (submenu_changed), + child, + 0); } } @@ -1258,6 +1269,27 @@ container_iterate (GtkWidget *widget, dbusmenu_menuitem_child_append (root, child); } +static void +submenu_changed (GtkWidget *widget, + GtkWidget *child, + gpointer data) +{ + DbusmenuMenuitem *root = (DbusmenuMenuitem *)data; + GList *children, *l; + children = dbusmenu_menuitem_get_children (root); + + for (l = children; l;) + { + DbusmenuMenuitem *c = (DbusmenuMenuitem *)l->data; + l = l->next; + dbusmenu_menuitem_child_delete (root, c); + } + + gtk_container_forall (GTK_CONTAINER (widget), + container_iterate, + root); +} + static void setup_dbusmenu (AppIndicator *self) { -- cgit v1.2.3 From 3676f118f50dde2571fd72c4db7cae5bca7c983a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 15:26:50 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa3~menu1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f4651c..b98997d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.13-0ubuntu3~ppa3~menu1) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa3~menu1) lucid; urgency=low * Upstream merge * Menu updates connections - -- Ted Gould Mon, 22 Feb 2010 15:24:49 -0600 + -- Ted Gould Mon, 22 Feb 2010 15:26:49 -0600 indicator-application (0.0.13-0ubuntu3~ppa2) lucid; urgency=low -- cgit v1.2.3 From 1d6eba2448b2753cb3cc38e05d763a576d40b978 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 15:57:12 -0600 Subject: Looking at children with foreach instead of forall --- src/libappindicator/app-indicator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 361875d..0490031 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -1240,7 +1240,7 @@ container_iterate (GtkWidget *widget, submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget)); if (submenu != NULL) { - gtk_container_forall (GTK_CONTAINER (submenu), + gtk_container_foreach (GTK_CONTAINER (submenu), container_iterate, child); g_signal_connect_object (submenu, @@ -1285,7 +1285,7 @@ submenu_changed (GtkWidget *widget, dbusmenu_menuitem_child_delete (root, c); } - gtk_container_forall (GTK_CONTAINER (widget), + gtk_container_foreach (GTK_CONTAINER (widget), container_iterate, root); } @@ -1301,7 +1301,7 @@ setup_dbusmenu (AppIndicator *self) if (priv->menu) { - gtk_container_forall (GTK_CONTAINER (priv->menu), + gtk_container_foreach (GTK_CONTAINER (priv->menu), container_iterate, root); } -- cgit v1.2.3 From bc743fa9de3904d9d497d94b409b7143194524e5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 16:01:40 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa3~menu2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 22eadad..81e47a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.13-0ubuntu3~ppa3~menu2) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa3~menu2) lucid; urgency=low * Upstream Merge * Using foreach instead of forall - -- Ted Gould Mon, 22 Feb 2010 15:57:23 -0600 + -- Ted Gould Mon, 22 Feb 2010 16:01:37 -0600 indicator-application (0.0.13-0ubuntu3~ppa3~menu1) lucid; urgency=low -- cgit v1.2.3 From 78429e88e6fd7354ec8a2dcbfe0931368a5b7fa2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 16:46:37 -0600 Subject: NO TEARY! --- src/libappindicator/app-indicator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 0490031..70ca6a2 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -1158,6 +1158,10 @@ container_iterate (GtkWidget *widget, const gchar *label = NULL; gboolean label_set = FALSE; + if (GTK_IS_TEAROFF_MENU_ITEM(widget)) { + return; + } + child = dbusmenu_menuitem_new (); if (GTK_IS_SEPARATOR_MENU_ITEM (widget)) -- cgit v1.2.3 From 4589ee89bc4ce73a430ef2b9ee43b7666be301b3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 22 Feb 2010 16:49:01 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa3~menu3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 48ed41d..572a494 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.13-0ubuntu3~ppa3~menu3) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa3~menu3) lucid; urgency=low * Upstream Merge * Blocking tearoffs - -- Ted Gould Mon, 22 Feb 2010 16:46:48 -0600 + -- Ted Gould Mon, 22 Feb 2010 16:48:59 -0600 indicator-application (0.0.13-0ubuntu3~ppa3~menu2) lucid; urgency=low -- cgit v1.2.3 From 44ff7ab931ed1cfadb8d18db1756ea656755d3ab Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Tue, 23 Feb 2010 08:33:29 -0600 Subject: Second patch on 524150 --- src/libappindicator/app-indicator.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 62e8905..97d5cd8 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -142,6 +142,7 @@ static void status_icon_activate (GtkStatusIcon * icon, gpointer data); static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); static void watcher_proxy_destroyed (GObject * object, gpointer data); static void client_menu_changed (GtkWidget *widget, GtkWidget *child, AppIndicator *indicator); +static void submenu_changed (GtkWidget *widget, GtkWidget *child, gpointer data); /* GObject type */ G_DEFINE_TYPE (AppIndicator, app_indicator, G_TYPE_OBJECT); @@ -1242,12 +1243,25 @@ container_iterate (GtkWidget *widget, gtk_container_forall (GTK_CONTAINER (submenu), container_iterate, child); + g_signal_connect_object (submenu, + "add", + G_CALLBACK (submenu_changed), + child, + 0); + g_signal_connect_object (submenu, + "remove", + G_CALLBACK (submenu_changed), + child, + 0); } } dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_ENABLED, GTK_WIDGET_IS_SENSITIVE (widget)); + dbusmenu_menuitem_property_set_bool (child, + DBUSMENU_MENUITEM_PROP_VISIBLE, + gtk_widget_get_visible (widget)); g_signal_connect (widget, "notify", G_CALLBACK (widget_notify_cb), child); @@ -1258,6 +1272,27 @@ container_iterate (GtkWidget *widget, dbusmenu_menuitem_child_append (root, child); } +static void +submenu_changed (GtkWidget *widget, + GtkWidget *child, + gpointer data) +{ + DbusmenuMenuitem *root = (DbusmenuMenuitem *)data; + GList *children, *l; + children = dbusmenu_menuitem_get_children (root); + + for (l = children; l;) + { + DbusmenuMenuitem *c = (DbusmenuMenuitem *)l->data; + l = l->next; + dbusmenu_menuitem_child_delete (root, c); + } + + gtk_container_forall (GTK_CONTAINER (widget), + container_iterate, + root); +} + static void setup_dbusmenu (AppIndicator *self) { -- cgit v1.2.3 From cbdd6a743bfc3e769db5e94a5a443f733d174c66 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Feb 2010 09:49:58 -0600 Subject: releasing version 0.0.13-0ubuntu3~ppa4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e4a3fa9..5151f6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-application (0.0.13-0ubuntu3~ppa4) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu3~ppa4) lucid; urgency=low * Upstream merge * Fixing automatic updating of menus @@ -6,7 +6,7 @@ indicator-application (0.0.13-0ubuntu3~ppa4) UNRELEASED; urgency=low * Handle null string attention icons * Handling the visibility of menus better - -- Ted Gould Tue, 23 Feb 2010 09:46:38 -0600 + -- Ted Gould Tue, 23 Feb 2010 09:49:56 -0600 indicator-application (0.0.13-0ubuntu3~ppa2) lucid; urgency=low -- cgit v1.2.3 From 1572f64f0a8329cfecd5395e643c538ad04ce54f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Feb 2010 10:26:10 -0600 Subject: Adding a check for dbus-glib version. The patch to unregister requires v. 0.82 --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 51ebf3e..a3c26e5 100644 --- a/configure.ac +++ b/configure.ac @@ -41,10 +41,12 @@ GTK_REQUIRED_VERSION=2.12 INDICATOR_REQUIRED_VERSION=0.3.1 DBUSMENUGTK_REQUIRED_VERSION=0.2.2 JSON_GLIB_REQUIRED_VERSION=0.7.6 +DBUS_GLIB_REQUIRED_VERSION=0.82 PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION) AC_SUBST(INDICATOR_CFLAGS) -- cgit v1.2.3 From 0d3da8efc1b3a2457ca0a3943a51c035e055fb84 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Feb 2010 10:28:19 -0600 Subject: debian/control: Checking for dbus-glib >= 0.82 --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 764015f..efe3326 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ indicator-application (0.0.13-0ubuntu8~ppa1) UNRELEASED; urgency=low * Upstream Merge * Checking for dbus-glib version 0.82 + * debian/control: Checking for dbus-glib >= 0.82 -- Ted Gould Tue, 23 Feb 2010 10:27:09 -0600 diff --git a/debian/control b/debian/control index 1a68874..68893c8 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5.0), cdbs (>= 0.4.41), python-central (>= 0.6), libgtk2.0-dev (>= 2.12.0), - libdbus-glib-1-dev, + libdbus-glib-1-dev (>= 0.82), libjson-glib-dev, gnome-doc-utils, gtk-doc-tools, -- cgit v1.2.3 From 1d1afe2b470221603dded93ffcb846c6c59fd545 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Feb 2010 10:30:30 -0600 Subject: releasing version 0.0.13-0ubuntu8~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index efe3326..075ddf2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.13-0ubuntu8~ppa1) UNRELEASED; urgency=low +indicator-application (0.0.13-0ubuntu8~ppa1) lucid; urgency=low * Upstream Merge * Checking for dbus-glib version 0.82 * debian/control: Checking for dbus-glib >= 0.82 - -- Ted Gould Tue, 23 Feb 2010 10:27:09 -0600 + -- Ted Gould Tue, 23 Feb 2010 10:30:27 -0600 indicator-application (0.0.13-0ubuntu7) lucid; urgency=low -- cgit v1.2.3