forked from enlightenment/enlightenment
tweak from previous shelf draw optimizing commit: now add a handler for module init end to more accurately check gadcon populate requests so we can determine if a shelf is "empty" and then show it. fixes case where a shelf has gadgets but none are populated because the modules are all unloaded
SVN revision: 76909
This commit is contained in:
parent
8233970853
commit
170c6d97c3
|
@ -36,6 +36,7 @@ static Eina_Bool _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev)
|
|||
static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static Eina_Bool _e_shelf_gadcon_populate_handler_cb(void *, int, void *);
|
||||
static Eina_Bool _e_shelf_module_init_end_handler_cb(void *, int, void *);
|
||||
|
||||
static Eina_List *shelves = NULL;
|
||||
static Eina_List *dummies = NULL;
|
||||
|
@ -82,6 +83,7 @@ static const char *orient_names[] =
|
|||
EAPI int E_EVENT_SHELF_ADD = -1;
|
||||
EAPI int E_EVENT_SHELF_DEL = -1;
|
||||
static Ecore_Event_Handler *_e_shelf_gadcon_populate_handler = NULL;
|
||||
static Ecore_Event_Handler *_e_shelf_module_init_end_handler = NULL;
|
||||
|
||||
/* externally accessible functions */
|
||||
EINTERN int
|
||||
|
@ -90,6 +92,7 @@ e_shelf_init(void)
|
|||
E_EVENT_SHELF_ADD = ecore_event_type_new();
|
||||
E_EVENT_SHELF_DEL = ecore_event_type_new();
|
||||
_e_shelf_gadcon_populate_handler = ecore_event_handler_add(E_EVENT_GADCON_POPULATE, _e_shelf_gadcon_populate_handler_cb, NULL);
|
||||
_e_shelf_module_init_end_handler = ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_shelf_module_init_end_handler_cb, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -105,6 +108,7 @@ e_shelf_shutdown(void)
|
|||
e_object_del(E_OBJECT(es));
|
||||
}
|
||||
_e_shelf_gadcon_populate_handler = ecore_event_handler_del(_e_shelf_gadcon_populate_handler);
|
||||
_e_shelf_module_init_end_handler = ecore_event_handler_del(_e_shelf_module_init_end_handler);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1044,7 +1048,7 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
|
|||
* if its gadcon has not populated; instead we show it in
|
||||
* the E_EVENT_GADCON_POPULATE handler
|
||||
*/
|
||||
if (es->gadcon->clients || (!es->gadcon->cf->clients))
|
||||
if ((es->gadcon->populated_classes && es->gadcon->clients) || (!es->gadcon->cf->clients))
|
||||
e_shelf_show(es);
|
||||
}
|
||||
|
||||
|
@ -2142,6 +2146,20 @@ _e_shelf_cb_instant_hide_timer(void *data)
|
|||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_shelf_module_init_end_handler_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
Eina_List *l;
|
||||
E_Shelf *es;
|
||||
|
||||
EINA_LIST_FOREACH(shelves, l, es)
|
||||
{
|
||||
if ((!es->gadcon->populate_requests) || (!es->gadcon->cf->clients))
|
||||
e_shelf_show(es);
|
||||
}
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_shelf_gadcon_populate_handler_cb(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue