aboutsummaryrefslogtreecommitdiff
path: root/src/messages-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-04 17:31:54 -0500
committerTed Gould <ted@canonical.com>2009-09-04 17:31:54 -0500
commitcb98b75a8ed64e1fd815b412b007ead62d46aace (patch)
tree7cdef8abc1fb3b75d271faac1e80557913fedb00 /src/messages-service.c
parente8505fb54db95018b89d29682f507fbb8e56cad2 (diff)
downloadayatana-indicator-messages-cb98b75a8ed64e1fd815b412b007ead62d46aace.tar.gz
ayatana-indicator-messages-cb98b75a8ed64e1fd815b412b007ead62d46aace.tar.bz2
ayatana-indicator-messages-cb98b75a8ed64e1fd815b412b007ead62d46aace.zip
If the item was shown, and we're in an overload case, we need to find someone else to show when we're dying.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r--src/messages-service.c12
1 files changed, 12 insertions, 0 deletions
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;