gboolean tray_appindicator_create(gpointer data) { if (is_exist_tray_appindicator()) return FALSE; if (tray_appindicator) { if (app_indicator_get_status (tray_appindicator) != APP_INDICATOR_STATUS_ACTIVE) { app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE); destroy_other_tray(); } } else { destroy_other_tray(); if (!tray_appindicator_load_icon(HIME_TRAY_PNG, HIME_TRAY_PNG, iconame, icondir)) return FALSE; tray_appindicator = app_indicator_new_with_path ("hime", iconame, APP_INDICATOR_CATEGORY_APPLICATION_STATUS, icondir); if(tray_appindicator == NULL) return TRUE; app_indicator_set_status (tray_appindicator, APP_INDICATOR_STATUS_ACTIVE); GtkWidget *menu = NULL; menu = create_tray_menu(mitems); app_indicator_set_secondary_activate_target(tray_appindicator, mitems[0].item); app_indicator_set_menu (tray_appindicator, GTK_MENU (menu)); } load_tray_appindicator(); return FALSE; }
void disp_tray_icon() { if (!hime_status_tray) return destroy_tray(); // dbg("disp_tray_icon\n"); if (hime_tray_display == HIME_TRAY_DISPLAY_SINGLE) load_tray_icon(); if (hime_tray_display == HIME_TRAY_DISPLAY_DOUBLE) load_tray_icon_double(); #if TRAY_UNITY if (hime_tray_display == HIME_TRAY_DISPLAY_APPINDICATOR) load_tray_appindicator(); #endif }