summaryrefslogtreecommitdiffstats
path: root/apps/gui/list.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-03-14 22:16:58 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-03-14 22:52:24 +1100
commitcb9bc3bbc8a66c3d5296bfbc68f4487c39c6ac68 (patch)
tree9350c7890142aa0c58cddf2cb30076ff30bf5b6d /apps/gui/list.c
parent47115ba8347f857fa5f59dc4326127e5849ea4eb (diff)
downloadrockbox-cb9bc3bbc8a66c3d5296bfbc68f4487c39c6ac68.tar.gz
rockbox-cb9bc3bbc8a66c3d5296bfbc68f4487c39c6ac68.tar.bz2
rockbox-cb9bc3bbc8a66c3d5296bfbc68f4487c39c6ac68.zip
Fix FS#12606 - next track can cause the screen to be cleared
This is a bit of a hack. We now trigger an event when the skin engine is doing a full redraw (which means fullscreen clear) before the lcd_update() to give the current screen a chance to redraw to avoid the screen flicker. This commit fixes the issue for screens which are entirely the list widget (i.e browser and menus), other screens will need aditional fixes (i.e quickscreen, time&date screen) Change-Id: I3ffdcd8ccad2c663732f8d5983049c837de00fe5
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r--apps/gui/list.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index d1b2748a60..96b3447728 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -596,6 +596,23 @@ bool gui_synclist_keyclick_callback(int action, void* data)
}
#endif
+/*
+ * Magic to make sure the list gets updated correctly if the skin does
+ * something naughty like a full screen update when we are in a button
+ * loop.
+ *
+ * The GUI_EVENT_NEED_UI_UPDATE event is registered for in list_do_action_timeout()
+ * and unregistered in gui_synclict_do_button(). This is done because
+ * if something is using the list UI they *must* be calling those
+ * two functions in the correct order or the list wont work.
+ */
+static struct gui_synclist *current_lists;
+void _lists_uiviewport_update_callback(void *data)
+{
+ (void)data;
+ gui_synclist_draw(current_lists);
+}
+
bool gui_synclist_do_button(struct gui_synclist * lists,
int *actionptr, enum list_wrap wrap)
{
@@ -610,6 +627,8 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
static int next_item_modifier = 1;
static int last_accel_tick = 0;
+ remove_event(GUI_EVENT_NEED_UI_UPDATE, _lists_uiviewport_update_callback);
+
if (action != ACTION_TOUCHSCREEN)
{
if (global_settings.list_accel_start_delay)
@@ -772,6 +791,9 @@ int list_do_action_timeout(struct gui_synclist *lists, int timeout)
/* Returns the lowest of timeout or the delay until a postponed
scheduled announcement is due (if any). */
{
+ current_lists = lists;
+ add_event(GUI_EVENT_NEED_UI_UPDATE, false,
+ _lists_uiviewport_update_callback);
if(lists->scheduled_talk_tick)
{
long delay = lists->scheduled_talk_tick -current_tick +1;