From 18c8e554fdda7a5bd9a02bbcbe7a809414cf29c3 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 22 Mar 2025 16:11:40 +0100 Subject: [PATCH] Eliminate SBS update on WPS exit Prevents flashing an outdated backdrop when moving from WPS to SBS, if both were using the extra frame buffer (i.e. both used background viewports), without having to update the SBS first. I think, this is actually what we want, rather than commit c1222d65e2, which attempted the same thing. Change-Id: Iffc7fe2d351ebdf21a4e7629aba93641c0d30b50 --- apps/gui/viewport.c | 13 ++++++++++++- apps/gui/wps.c | 11 ----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index cf81f7d009..8e48ac261e 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -57,6 +57,7 @@ #include "language.h" #include "statusbar-skinned.h" #include "skin_engine/skin_engine.h" +#include "skin_engine/wps_internals.h" #include "debug.h" #define VPSTACK_DEPTH 16 @@ -122,7 +123,17 @@ static void toggle_theme(enum screen_type screen, bool force) /* remove the left overs from the previous screen. * could cause a tiny flicker. Redo your screen code if that happens */ #ifdef HAVE_BACKDROP_IMAGE - skin_backdrop_show(sb_get_backdrop(screen)); + int backdrop_id = sb_get_backdrop(screen); + if (get_current_activity() == ACTIVITY_WPS) + { + struct wps_data *sbs = skin_get_gwps(CUSTOM_STATUSBAR, screen)->data; + struct wps_data *wps = skin_get_gwps(WPS, screen)->data; + /* Extra framebuffer shared between WPS and SBS; + prevents flashing previous backdrop: */ + if (wps->use_extra_framebuffer && sbs->use_extra_framebuffer) + backdrop_id = -1; + } + skin_backdrop_show(backdrop_id); #endif if (LIKELY(after_boot[screen]) && (!was_enabled[screen] || force)) { diff --git a/apps/gui/wps.c b/apps/gui/wps.c index c552709f24..080fb461b8 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -542,18 +542,7 @@ static void gwps_leave_wps(bool theme_enabled) struct gui_wps *gwps = skin_get_gwps(WPS, i); gwps->display->scroll_stop(); if (theme_enabled) - { -#ifdef HAVE_BACKDROP_IMAGE - skin_backdrop_show(sb_get_backdrop(i)); - - /* The following is supposed to erase any traces of %VB - viewports drawn by the WPS. May need further thought... */ - struct wps_data *sbs = skin_get_gwps(CUSTOM_STATUSBAR, i)->data; - if (gwps->data->use_extra_framebuffer && sbs->use_extra_framebuffer) - skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL); -#endif viewportmanager_theme_undo(i, skin_has_sbs(gwps)); - } } #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)