From d78be6716b504b00a4bf9b1d637bdb878f303063 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 10 Oct 2023 10:01:52 -0400 Subject: [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 --- apps/cuesheet.c | 2 ++ apps/debug_menu.c | 4 ++++ apps/gui/list.c | 25 ++++++++++++++----------- apps/gui/wps.c | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 263fed154d..bbdc93746e 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -523,6 +523,8 @@ void browse_cuesheet(struct cuesheet *cue) case ACTION_STD_CANCEL: done = true; + default: + break; } } } diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 6794b3fe9f..5b73f8badd 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -209,6 +209,10 @@ static int dbg_threads_action_callback(int action, struct gui_synclist *lists) *x_offset += 1; action = ACTION_REDRAW; } + else if (IS_SYSEVENT(action)) + { + return ACTION_REDRAW; + } else if (action != ACTION_UNKNOWN) { *x_offset = 0; diff --git a/apps/gui/list.c b/apps/gui/list.c index 652279a9de..85046ead54 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -577,7 +577,7 @@ bool gui_synclist_keyclick_callback(int action, void* data) 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 last_accel_tick = 0; + if (IS_SYSEVENT(action)) + return false; + if (action != ACTION_TOUCHSCREEN) { 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 */ current_lists = NULL; - /* Prevent list wraparound by repeating actions */ + /* repeat actions block list 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) { @@ -669,8 +667,11 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr) adjust_volume(-1); return true; #endif - case ACTION_STD_PREV: 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); #ifndef HAVE_WHEEL_ACCELERATION 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; return true; - case ACTION_STD_NEXT: 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); #ifndef HAVE_WHEEL_ACCELERATION if (button_queue_count() < FRAMEDROP_TRIGGER) @@ -733,7 +736,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr) SCREEN_REMOTE : #endif SCREEN_MAIN; - gui_synclist_select_previous_page(lists, screen, allow_wrap); + gui_synclist_select_previous_page(lists, screen, false); gui_synclist_draw(lists); yield(); *actionptr = ACTION_STD_NEXT; @@ -748,7 +751,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr) SCREEN_REMOTE : #endif SCREEN_MAIN; - gui_synclist_select_next_page(lists, screen, allow_wrap); + gui_synclist_select_next_page(lists, screen, false); gui_synclist_draw(lists); yield(); *actionptr = ACTION_STD_PREV; diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 2a595f74e6..260730c4a1 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -322,7 +322,7 @@ static bool ffwd_rew(int button, bool seek_from_end) #endif if (button != ACTION_WPS_SEEKFWD && button != ACTION_WPS_SEEKBACK - && button != 0) + && button != 0 && !IS_SYSEVENT(button)) button = ACTION_WPS_STOPSEEK; } } -- cgit v1.2.3