From cb98b75a8ed64e1fd815b412b007ead62d46aace Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 4 Sep 2009 17:31:54 -0500 Subject: If the item was shown, and we're in an overload case, we need to find someone else to show when we're dying. --- src/messages-service.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/messages-service.c') diff --git a/src/messages-service.c b/src/messages-service.c index f7c879f..e5024fe 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -758,6 +758,18 @@ indicator_removed (IndicateListener * listener, IndicateListenerServer * server, g_signal_handler_disconnect(menuitem, ilt->timechange_cb); g_free(ilt); + if (im_menu_item_shown(IM_MENU_ITEM(menuitem)) && g_list_length(sl_item->imList) >= MAX_NUMBER_OF_INDICATORS) { + /* In this case we need to show a different indicator + becasue a shown one has left. But we're going to be + easy and set all the values. */ + GList * indicatoritem; + gint count; + for (indicatoritem = sl_item->imList, count = 0; indicatoritem != NULL; indicatoritem = g_list_next(indicatoritem), count++) { + imList_t * im = (imList_t *)indicatoritem->data; + im_menu_item_show(IM_MENU_ITEM(im->menuitem), count < MAX_NUMBER_OF_INDICATORS); + } + } + dbusmenu_menuitem_property_set(menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); dbusmenu_menuitem_child_delete(DBUSMENU_MENUITEM(data), menuitem); removed = TRUE; -- cgit v1.2.3