1
0
Fork 0
forked from len0rd/rockbox

[BUGFIX] block SYS_EVENTS from some action switches

fixes some of the places where SYS EVENTS cause issues with action switches
that don't have handling for system events

more exist..

Change-Id: Ie6f4b05ed7ef1119d43e65ee49be8f754af83f52
This commit is contained in:
William Wilgus 2023-10-10 10:01:52 -04:00 committed by William Wilgus
parent d77c417fd1
commit d78be6716b
4 changed files with 21 additions and 12 deletions

View file

@ -523,6 +523,8 @@ void browse_cuesheet(struct cuesheet *cue)
case ACTION_STD_CANCEL: case ACTION_STD_CANCEL:
done = true; done = true;
default:
break;
} }
} }
} }

View file

@ -209,6 +209,10 @@ static int dbg_threads_action_callback(int action, struct gui_synclist *lists)
*x_offset += 1; *x_offset += 1;
action = ACTION_REDRAW; action = ACTION_REDRAW;
} }
else if (IS_SYSEVENT(action))
{
return ACTION_REDRAW;
}
else if (action != ACTION_UNKNOWN) else if (action != ACTION_UNKNOWN)
{ {
*x_offset = 0; *x_offset = 0;

View file

@ -577,7 +577,7 @@ bool gui_synclist_keyclick_callback(int action, void* data)
return false; return false;
} }
return action != ACTION_NONE; return action != ACTION_NONE && !IS_SYSEVENT(action);
} }
/* /*
@ -611,6 +611,9 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
static int next_item_modifier = 1; static int next_item_modifier = 1;
static int last_accel_tick = 0; static int last_accel_tick = 0;
if (IS_SYSEVENT(action))
return false;
if (action != ACTION_TOUCHSCREEN) if (action != ACTION_TOUCHSCREEN)
{ {
if (global_settings.list_accel_start_delay) if (global_settings.list_accel_start_delay)
@ -647,13 +650,8 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
/* Disable the skin redraw callback */ /* Disable the skin redraw callback */
current_lists = NULL; current_lists = NULL;
/* Prevent list wraparound by repeating actions */ /* repeat actions block list wraparound */
bool allow_wrap = lists->wraparound; bool allow_wrap = lists->wraparound;
if (action == ACTION_STD_PREVREPEAT ||
action == ACTION_STD_NEXTREPEAT ||
action == ACTION_LISTTREE_PGUP ||
action == ACTION_LISTTREE_PGDOWN)
allow_wrap = false;
switch (action) switch (action)
{ {
@ -669,8 +667,11 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
adjust_volume(-1); adjust_volume(-1);
return true; return true;
#endif #endif
case ACTION_STD_PREV:
case ACTION_STD_PREVREPEAT: case ACTION_STD_PREVREPEAT:
allow_wrap = false; /* Prevent list wraparound on repeating actions */
/*Fallthrough*/
case ACTION_STD_PREV:
gui_list_select_at_offset(lists, -next_item_modifier, allow_wrap); gui_list_select_at_offset(lists, -next_item_modifier, allow_wrap);
#ifndef HAVE_WHEEL_ACCELERATION #ifndef HAVE_WHEEL_ACCELERATION
if (button_queue_count() < FRAMEDROP_TRIGGER) if (button_queue_count() < FRAMEDROP_TRIGGER)
@ -680,8 +681,10 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
*actionptr = ACTION_STD_PREV; *actionptr = ACTION_STD_PREV;
return true; return true;
case ACTION_STD_NEXT:
case ACTION_STD_NEXTREPEAT: case ACTION_STD_NEXTREPEAT:
allow_wrap = false; /* Prevent list wraparound on repeating actions */
/*Fallthrough*/
case ACTION_STD_NEXT:
gui_list_select_at_offset(lists, next_item_modifier, allow_wrap); gui_list_select_at_offset(lists, next_item_modifier, allow_wrap);
#ifndef HAVE_WHEEL_ACCELERATION #ifndef HAVE_WHEEL_ACCELERATION
if (button_queue_count() < FRAMEDROP_TRIGGER) if (button_queue_count() < FRAMEDROP_TRIGGER)
@ -733,7 +736,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
SCREEN_REMOTE : SCREEN_REMOTE :
#endif #endif
SCREEN_MAIN; SCREEN_MAIN;
gui_synclist_select_previous_page(lists, screen, allow_wrap); gui_synclist_select_previous_page(lists, screen, false);
gui_synclist_draw(lists); gui_synclist_draw(lists);
yield(); yield();
*actionptr = ACTION_STD_NEXT; *actionptr = ACTION_STD_NEXT;
@ -748,7 +751,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
SCREEN_REMOTE : SCREEN_REMOTE :
#endif #endif
SCREEN_MAIN; SCREEN_MAIN;
gui_synclist_select_next_page(lists, screen, allow_wrap); gui_synclist_select_next_page(lists, screen, false);
gui_synclist_draw(lists); gui_synclist_draw(lists);
yield(); yield();
*actionptr = ACTION_STD_PREV; *actionptr = ACTION_STD_PREV;

View file

@ -322,7 +322,7 @@ static bool ffwd_rew(int button, bool seek_from_end)
#endif #endif
if (button != ACTION_WPS_SEEKFWD if (button != ACTION_WPS_SEEKFWD
&& button != ACTION_WPS_SEEKBACK && button != ACTION_WPS_SEEKBACK
&& button != 0) && button != 0 && !IS_SYSEVENT(button))
button = ACTION_WPS_STOPSEEK; button = ACTION_WPS_STOPSEEK;
} }
} }