forked from enlightenment/enlightenment
create default apps menu on init, don't free efreet menus on shutdown to prevent race condition triggered by people with superhuman menu navigation abilities
SVN revision: 76895
This commit is contained in:
parent
5e0b6fd200
commit
523597cdcb
|
@ -64,7 +64,7 @@ static void _e_int_menus_main_exit(void *data, E_Menu *m, E_Menu_Item *mi
|
||||||
static void _e_int_menus_desktops_free_hook(void *obj);
|
static void _e_int_menus_desktops_free_hook(void *obj);
|
||||||
static void _e_int_menus_desk_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
static void _e_int_menus_desk_item_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||||
static void _e_int_menus_item_label_set(Efreet_Menu *entry, E_Menu_Item *mi);
|
static void _e_int_menus_item_label_set(Efreet_Menu *entry, E_Menu_Item *mi);
|
||||||
|
static Efreet_Menu *_e_int_menus_apps_thread_new(E_Menu *m, const char *dir);
|
||||||
//static void _e_int_menus_apps_drag_finished(E_Drag *drag, int dropped __UNUSED__);
|
//static void _e_int_menus_apps_drag_finished(E_Drag *drag, int dropped __UNUSED__);
|
||||||
|
|
||||||
/* local subsystem globals */
|
/* local subsystem globals */
|
||||||
|
@ -477,18 +477,21 @@ e_int_menus_menu_augmentation_point_disabled_set(const char *menu, Eina_Bool dis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EINTERN void
|
||||||
|
e_int_menus_init(void)
|
||||||
|
{
|
||||||
|
if (e_config->menu_apps_show)
|
||||||
|
_e_int_menus_apps_thread_new(NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
EINTERN void
|
EINTERN void
|
||||||
e_int_menus_shutdown(void)
|
e_int_menus_shutdown(void)
|
||||||
{
|
{
|
||||||
E_FREE_LIST(_e_int_menus_app_threads, ecore_thread_cancel);
|
E_FREE_LIST(_e_int_menus_app_threads, ecore_thread_cancel);
|
||||||
if (_e_int_menus_app_cleaner) ecore_timer_del(_e_int_menus_app_cleaner);
|
if (_e_int_menus_app_cleaner) ecore_timer_del(_e_int_menus_app_cleaner);
|
||||||
_e_int_menus_app_cleaner = NULL;
|
_e_int_menus_app_cleaner = NULL;
|
||||||
eina_hash_free(_e_int_menus_app_menus);
|
|
||||||
_e_int_menus_app_menus = NULL;
|
|
||||||
eina_hash_free(_e_int_menus_app_menus_waiting);
|
eina_hash_free(_e_int_menus_app_menus_waiting);
|
||||||
_e_int_menus_app_menus_waiting = NULL;
|
_e_int_menus_app_menus_waiting = NULL;
|
||||||
if (_e_int_menus_app_menu_default) efreet_menu_free(_e_int_menus_app_menu_default);
|
|
||||||
_e_int_menus_app_menu_default = NULL;
|
|
||||||
_e_int_menus_app_menu_default_waiting = NULL;
|
_e_int_menus_app_menu_default_waiting = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,7 +734,7 @@ _e_int_menus_apps_thread_new(E_Menu *m, const char *dir)
|
||||||
mn = _e_int_menus_app_menu_default_waiting;
|
mn = _e_int_menus_app_menu_default_waiting;
|
||||||
|
|
||||||
if (mn) return NULL;
|
if (mn) return NULL;
|
||||||
if (dir)
|
if (dir && m)
|
||||||
eina_hash_add(_e_int_menus_app_menus_waiting, dir, m);
|
eina_hash_add(_e_int_menus_app_menus_waiting, dir, m);
|
||||||
else
|
else
|
||||||
_e_int_menus_app_menu_default_waiting = m;
|
_e_int_menus_app_menu_default_waiting = m;
|
||||||
|
|
|
@ -62,6 +62,7 @@ EAPI void e_int_menus_menu_augmentation_del(const char *menu
|
||||||
EAPI void e_int_menus_menu_augmentation_point_disabled_set(const char *menu,
|
EAPI void e_int_menus_menu_augmentation_point_disabled_set(const char *menu,
|
||||||
Eina_Bool disabled);
|
Eina_Bool disabled);
|
||||||
|
|
||||||
|
EINTERN void e_int_menus_init(void);
|
||||||
EINTERN void e_int_menus_shutdown(void);
|
EINTERN void e_int_menus_shutdown(void);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -186,6 +186,7 @@ e_menu_init(void)
|
||||||
_e_menu_categories = eina_hash_string_superfast_new(NULL);
|
_e_menu_categories = eina_hash_string_superfast_new(NULL);
|
||||||
|
|
||||||
if (!_e_menu_hash) _e_menu_hash = eina_hash_string_superfast_new(NULL);
|
if (!_e_menu_hash) _e_menu_hash = eina_hash_string_superfast_new(NULL);
|
||||||
|
e_int_menus_init();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue