From 160905b1b82d87a81a8ad1aa776b35b477b7a87b Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Thu, 28 May 2026 12:09:42 +0200 Subject: [PATCH] gui: list: update skin in gui_synclist_set_title Moving the skin update from gui_synclist_set_title to gui_synclist_draw (c41beeb) had the inadvertent side effect that, if gui_synclist_select_item was called in between, it may have missed a configured skinlist that only got enabled by the skin update. Which could lead to a selection appearing off screen. This was mainly an issue if you had popped an activity, which resets the skinlist cfg to NULL, but didn't perform a skin update before the call to gui_synclist_select_item. Now that GUI_EVENT_ACTIONREDRAW can be used instead of GUI_EVENT_ACTIONUPDATE to prevent the display from being updated, we may as well update the skin immediately in gui_synclist_set_title again. Change-Id: Iaee98d670ffb8d7b6590bd2ba11827fef5fba5a8 --- apps/gui/list.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 48fc5661fb..8a94ac3ada 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -49,8 +49,6 @@ void list_draw(struct screen *display, struct gui_synclist *list); static long last_dirty_tick; -static bool sb_title_is_dirty; -static bool theme_enabled; static struct viewport parent[NB_SCREENS]; static struct gui_synclist *current_lists; @@ -224,32 +222,11 @@ int gui_list_get_item_offset(struct gui_synclist * gui_list, return item_offset; } -static void sb_title_cb(unsigned short id, void *data, void *userdata) -{ - (void)id; - (void)data; - theme_enabled = true; - gui_synclist_draw((struct gui_synclist *) userdata); -} - /* * Force a full screen update. */ void gui_synclist_draw(struct gui_synclist *gui_list) { - if (sb_title_is_dirty) - { - sb_title_is_dirty = theme_enabled = false; - - /* Redraw skin, and make skin engine call us back */ - add_event_ex(GUI_EVENT_NEED_UI_UPDATE, true, sb_title_cb, gui_list); - send_event(GUI_EVENT_ACTIONREDRAW, (void*)1); - remove_event_ex(GUI_EVENT_NEED_UI_UPDATE, sb_title_cb, gui_list); - - /* sb_title_cb was only called if theme is enabled */ - if (theme_enabled) - return; - } if (list_is_dirty(gui_list)) { list_init_viewports(gui_list); @@ -465,7 +442,7 @@ void gui_synclist_set_title(struct gui_synclist * gui_list, gui_list->title_icon = icon; FOR_NB_SCREENS(i) sb_set_title_text(title, icon, i); - sb_title_is_dirty = true; + send_event(GUI_EVENT_ACTIONREDRAW, (void*)1); } void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)