diff options
-rw-r--r-- | apps/appevents.h | 3 | ||||
-rw-r--r-- | apps/gui/list.c | 22 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_render.c | 8 |
3 files changed, 33 insertions, 0 deletions
diff --git a/apps/appevents.h b/apps/appevents.h index 36e19b0df7..5cb0ee57b2 100644 --- a/apps/appevents.h +++ b/apps/appevents.h | |||
@@ -61,6 +61,9 @@ enum { | |||
61 | GUI_EVENT_STATUSBAR_TOGGLE = (EVENT_CLASS_GUI|1), | 61 | GUI_EVENT_STATUSBAR_TOGGLE = (EVENT_CLASS_GUI|1), |
62 | GUI_EVENT_ACTIONUPDATE, | 62 | GUI_EVENT_ACTIONUPDATE, |
63 | GUI_EVENT_THEME_CHANGED, | 63 | GUI_EVENT_THEME_CHANGED, |
64 | /* Called when the UI viewport is cleared in the skin engine to | ||
65 | * notify the current screen that it needs to do an update */ | ||
66 | GUI_EVENT_NEED_UI_UPDATE, | ||
64 | }; | 67 | }; |
65 | 68 | ||
66 | /** Recording events **/ | 69 | /** Recording events **/ |
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) | |||
596 | } | 596 | } |
597 | #endif | 597 | #endif |
598 | 598 | ||
599 | /* | ||
600 | * Magic to make sure the list gets updated correctly if the skin does | ||
601 | * something naughty like a full screen update when we are in a button | ||
602 | * loop. | ||
603 | * | ||
604 | * The GUI_EVENT_NEED_UI_UPDATE event is registered for in list_do_action_timeout() | ||
605 | * and unregistered in gui_synclict_do_button(). This is done because | ||
606 | * if something is using the list UI they *must* be calling those | ||
607 | * two functions in the correct order or the list wont work. | ||
608 | */ | ||
609 | static struct gui_synclist *current_lists; | ||
610 | void _lists_uiviewport_update_callback(void *data) | ||
611 | { | ||
612 | (void)data; | ||
613 | gui_synclist_draw(current_lists); | ||
614 | } | ||
615 | |||
599 | bool gui_synclist_do_button(struct gui_synclist * lists, | 616 | bool gui_synclist_do_button(struct gui_synclist * lists, |
600 | int *actionptr, enum list_wrap wrap) | 617 | int *actionptr, enum list_wrap wrap) |
601 | { | 618 | { |
@@ -610,6 +627,8 @@ bool gui_synclist_do_button(struct gui_synclist * lists, | |||
610 | static int next_item_modifier = 1; | 627 | static int next_item_modifier = 1; |
611 | static int last_accel_tick = 0; | 628 | static int last_accel_tick = 0; |
612 | 629 | ||
630 | remove_event(GUI_EVENT_NEED_UI_UPDATE, _lists_uiviewport_update_callback); | ||
631 | |||
613 | if (action != ACTION_TOUCHSCREEN) | 632 | if (action != ACTION_TOUCHSCREEN) |
614 | { | 633 | { |
615 | if (global_settings.list_accel_start_delay) | 634 | if (global_settings.list_accel_start_delay) |
@@ -772,6 +791,9 @@ int list_do_action_timeout(struct gui_synclist *lists, int timeout) | |||
772 | /* Returns the lowest of timeout or the delay until a postponed | 791 | /* Returns the lowest of timeout or the delay until a postponed |
773 | scheduled announcement is due (if any). */ | 792 | scheduled announcement is due (if any). */ |
774 | { | 793 | { |
794 | current_lists = lists; | ||
795 | add_event(GUI_EVENT_NEED_UI_UPDATE, false, | ||
796 | _lists_uiviewport_update_callback); | ||
775 | if(lists->scheduled_talk_tick) | 797 | if(lists->scheduled_talk_tick) |
776 | { | 798 | { |
777 | long delay = lists->scheduled_talk_tick -current_tick +1; | 799 | long delay = lists->scheduled_talk_tick -current_tick +1; |
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c index 80d8c83d27..965d785233 100644 --- a/apps/gui/skin_engine/skin_render.c +++ b/apps/gui/skin_engine/skin_render.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "config.h" | 29 | #include "config.h" |
30 | #include "core_alloc.h" | 30 | #include "core_alloc.h" |
31 | #include "kernel.h" | 31 | #include "kernel.h" |
32 | #include "appevents.h" | ||
32 | #ifdef HAVE_ALBUMART | 33 | #ifdef HAVE_ALBUMART |
33 | #include "albumart.h" | 34 | #include "albumart.h" |
34 | #endif | 35 | #endif |
@@ -859,6 +860,13 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) | |||
859 | display->set_framebuffer(NULL); | 860 | display->set_framebuffer(NULL); |
860 | skin_backdrop_show(data->backdrop_id); | 861 | skin_backdrop_show(data->backdrop_id); |
861 | #endif | 862 | #endif |
863 | |||
864 | if (((refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL)) | ||
865 | { | ||
866 | /* If this is the UI viewport then let the UI know | ||
867 | * to redraw itself */ | ||
868 | send_event(GUI_EVENT_NEED_UI_UPDATE, NULL); | ||
869 | } | ||
862 | /* Restore the default viewport */ | 870 | /* Restore the default viewport */ |
863 | display->set_viewport(NULL); | 871 | display->set_viewport(NULL); |
864 | display->update(); | 872 | display->update(); |