Pass userdata handle to get_selection callback

This commit is contained in:
twinaphex 2015-12-11 14:50:06 +01:00
parent 2215aa2c87
commit 9e383749ae
3 changed files with 4 additions and 5 deletions

View File

@ -1316,8 +1316,7 @@ static int mui_list_push(void *data, void *userdata,
static size_t mui_list_get_selection(void *data)
{
menu_handle_t *menu = (menu_handle_t*)data;
mui_handle_t *mui = menu ? (mui_handle_t*)menu->userdata : NULL;
mui_handle_t *mui = (mui_handle_t*)data;
if (!mui)
return 0;

View File

@ -253,8 +253,7 @@ static void xmb_fill_default_background_path(xmb_handle_t *xmb, char *path, size
static size_t xmb_list_get_selection(void *data)
{
menu_handle_t *menu = (menu_handle_t*)data;
xmb_handle_t *xmb = menu ? (xmb_handle_t*)menu->userdata : NULL;
xmb_handle_t *xmb = (xmb_handle_t*)data;
if (!xmb)
return 0;

View File

@ -198,7 +198,8 @@ size_t menu_driver_list_get_selection(void)
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
if (driver && driver->list_get_selection)
return driver->list_get_selection(menu_driver_data);
return driver->list_get_selection(menu_driver_data
? menu_driver_data->userdata : NULL);
return 0;
}