summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2023-10-10 10:01:52 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2023-10-30 19:03:18 -0400
commitd78be6716b504b00a4bf9b1d637bdb878f303063 (patch)
tree3be1ce5669ae5b1bfd39589010f50599ac1d0b41
parentd77c417fd1bfb79013bbd2c47920d89b95a5ac76 (diff)
downloadrockbox-d78be6716b504b00a4bf9b1d637bdb878f303063.tar.gz
rockbox-d78be6716b504b00a4bf9b1d637bdb878f303063.zip
[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
-rw-r--r--apps/cuesheet.c2
-rw-r--r--apps/debug_menu.c4
-rw-r--r--apps/gui/list.c25
-rw-r--r--apps/gui/wps.c2
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)
523 523
524 case ACTION_STD_CANCEL: 524 case ACTION_STD_CANCEL:
525 done = true; 525 done = true;
526 default:
527 break;
526 } 528 }
527 } 529 }
528} 530}
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)
209 *x_offset += 1; 209 *x_offset += 1;
210 action = ACTION_REDRAW; 210 action = ACTION_REDRAW;
211 } 211 }
212 else if (IS_SYSEVENT(action))
213 {
214 return ACTION_REDRAW;
215 }
212 else if (action != ACTION_UNKNOWN) 216 else if (action != ACTION_UNKNOWN)
213 { 217 {
214 *x_offset = 0; 218 *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)
577 return false; 577 return false;
578 } 578 }
579 579
580 return action != ACTION_NONE; 580 return action != ACTION_NONE && !IS_SYSEVENT(action);
581} 581}
582 582
583/* 583/*
@@ -611,6 +611,9 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
611 static int next_item_modifier = 1; 611 static int next_item_modifier = 1;
612 static int last_accel_tick = 0; 612 static int last_accel_tick = 0;
613 613
614 if (IS_SYSEVENT(action))
615 return false;
616
614 if (action != ACTION_TOUCHSCREEN) 617 if (action != ACTION_TOUCHSCREEN)
615 { 618 {
616 if (global_settings.list_accel_start_delay) 619 if (global_settings.list_accel_start_delay)
@@ -647,13 +650,8 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
647 /* Disable the skin redraw callback */ 650 /* Disable the skin redraw callback */
648 current_lists = NULL; 651 current_lists = NULL;
649 652
650 /* Prevent list wraparound by repeating actions */ 653 /* repeat actions block list wraparound */
651 bool allow_wrap = lists->wraparound; 654 bool allow_wrap = lists->wraparound;
652 if (action == ACTION_STD_PREVREPEAT ||
653 action == ACTION_STD_NEXTREPEAT ||
654 action == ACTION_LISTTREE_PGUP ||
655 action == ACTION_LISTTREE_PGDOWN)
656 allow_wrap = false;
657 655
658 switch (action) 656 switch (action)
659 { 657 {
@@ -669,8 +667,11 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
669 adjust_volume(-1); 667 adjust_volume(-1);
670 return true; 668 return true;
671#endif 669#endif
672 case ACTION_STD_PREV:
673 case ACTION_STD_PREVREPEAT: 670 case ACTION_STD_PREVREPEAT:
671 allow_wrap = false; /* Prevent list wraparound on repeating actions */
672 /*Fallthrough*/
673 case ACTION_STD_PREV:
674
674 gui_list_select_at_offset(lists, -next_item_modifier, allow_wrap); 675 gui_list_select_at_offset(lists, -next_item_modifier, allow_wrap);
675#ifndef HAVE_WHEEL_ACCELERATION 676#ifndef HAVE_WHEEL_ACCELERATION
676 if (button_queue_count() < FRAMEDROP_TRIGGER) 677 if (button_queue_count() < FRAMEDROP_TRIGGER)
@@ -680,8 +681,10 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
680 *actionptr = ACTION_STD_PREV; 681 *actionptr = ACTION_STD_PREV;
681 return true; 682 return true;
682 683
683 case ACTION_STD_NEXT:
684 case ACTION_STD_NEXTREPEAT: 684 case ACTION_STD_NEXTREPEAT:
685 allow_wrap = false; /* Prevent list wraparound on repeating actions */
686 /*Fallthrough*/
687 case ACTION_STD_NEXT:
685 gui_list_select_at_offset(lists, next_item_modifier, allow_wrap); 688 gui_list_select_at_offset(lists, next_item_modifier, allow_wrap);
686#ifndef HAVE_WHEEL_ACCELERATION 689#ifndef HAVE_WHEEL_ACCELERATION
687 if (button_queue_count() < FRAMEDROP_TRIGGER) 690 if (button_queue_count() < FRAMEDROP_TRIGGER)
@@ -733,7 +736,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
733 SCREEN_REMOTE : 736 SCREEN_REMOTE :
734#endif 737#endif
735 SCREEN_MAIN; 738 SCREEN_MAIN;
736 gui_synclist_select_previous_page(lists, screen, allow_wrap); 739 gui_synclist_select_previous_page(lists, screen, false);
737 gui_synclist_draw(lists); 740 gui_synclist_draw(lists);
738 yield(); 741 yield();
739 *actionptr = ACTION_STD_NEXT; 742 *actionptr = ACTION_STD_NEXT;
@@ -748,7 +751,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr)
748 SCREEN_REMOTE : 751 SCREEN_REMOTE :
749#endif 752#endif
750 SCREEN_MAIN; 753 SCREEN_MAIN;
751 gui_synclist_select_next_page(lists, screen, allow_wrap); 754 gui_synclist_select_next_page(lists, screen, false);
752 gui_synclist_draw(lists); 755 gui_synclist_draw(lists);
753 yield(); 756 yield();
754 *actionptr = ACTION_STD_PREV; 757 *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)
322#endif 322#endif
323 if (button != ACTION_WPS_SEEKFWD 323 if (button != ACTION_WPS_SEEKFWD
324 && button != ACTION_WPS_SEEKBACK 324 && button != ACTION_WPS_SEEKBACK
325 && button != 0) 325 && button != 0 && !IS_SYSEVENT(button))
326 button = ACTION_WPS_STOPSEEK; 326 button = ACTION_WPS_STOPSEEK;
327 } 327 }
328 } 328 }