Created attachment 7387 Replace GHashTable with GList for application actions Currently GarconMenuItem uses a hash table to manage the list of application actions. An application has to call garcon_menu_item_get_actions() to get a list of action name and then call garcon_menu_item_get_action() to get information about the action. The problem with garcon_menu_item_get_actions() to get the list of action names is that the order of action names is unpredictable and not the order as specified in the desktop file as g_hash_table_get_keys() is used to create this list. This is a problem when creating a menu for these application action as the order could not make sense. To keep the order of action names the hash table was replace with a doubly-linked list (GList) and all application action related function were modified to maintain the GList. To keep API stable the function modified will behave as before, e.g. the actions names are not duplicated (g_strdup) but their pointers are copied as-is to the list in garcon_menu_item_get_actions(). The callee still has to free the list with g_list_free() but keep the data in the list untouched, i.e. not calling g_list_free_full(list, g_free). Also the data in the list are modified in-place - see garcon_menu_item_set_action(). A patch is applied for review at this bug.
Thanks for the patch, pushed to master in: https://git.xfce.org/xfce/garcon/commit/?id=8c14f977c06b531954b902ba9d593d22e1d77605