mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
touchscreen: Fix menu callbacks in touchscreen pointing mode
Touchscreen events get translated into standard actions only after the call to gui_synclist_do_button(). The menu callback doesn't get a chance to see the real action if it is called before do_button. Moving the do_button call up could potentially break callbacks that want to intercept actions before they hit the list code. Therefore we need to manually handle touch events first, and pass the action to do_button afterward. Fixes a bug where exiting a plugin in touchscreen point mode always goes to the games list because the callback wasn't invoked properly. Change-Id: I3b74a16d68a111935fba2157c15fa188f15446e9
This commit is contained in:
parent
fd4a10719d
commit
306caa2754
1 changed files with 7 additions and 0 deletions
|
@ -434,6 +434,13 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
|
||||||
/* query audio status to see if it changed */
|
/* query audio status to see if it changed */
|
||||||
redraw_lists = query_audio_status(&old_audio_status);
|
redraw_lists = query_audio_status(&old_audio_status);
|
||||||
|
|
||||||
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
|
/* need to translate touch actions *first* so the menu callback has
|
||||||
|
* a chance to intercept before it hits the list's do_button. */
|
||||||
|
if (action == ACTION_TOUCHSCREEN)
|
||||||
|
action = gui_synclist_do_touchscreen(&lists);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (menu_callback)
|
if (menu_callback)
|
||||||
{
|
{
|
||||||
int new_action = menu_callback(action, menu, &lists);
|
int new_action = menu_callback(action, menu, &lists);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue