From 0b5f1b68e6c52c6a86d199d8608e40e03d7dbbff Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 5 Jan 2025 22:09:48 -0500 Subject: [PATCH] [Bugfix] Copy current lcd contents into empty background buffers the manual states the following: %V(0,0,-,-,-) %VB Use %x(filename, 0, 0) to draw a backdrop image (If you want one!) Then add %V(0,0,-,-,-) if you forget then it causes display corruption due to the uninitialized background buffer instead make a copy of the current screen into the blank backdrop so we won't be showing garbled data on the screen Change-Id: I3f0df131d36537e91688e104c9445a604f657362 --- apps/gui/skin_engine/skin_backdrops.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c index 08937d8fdc..994640c1fb 100644 --- a/apps/gui/skin_engine/skin_backdrops.c +++ b/apps/gui/skin_engine/skin_backdrops.c @@ -203,7 +203,24 @@ bool skin_backdrops_preload(void) } } else + { backdrops[i].loaded = true; + /* Bugfix themes which don't use %VB properly */ + extern struct frame_buffer_t lcd_framebuffer_default; +#if defined(HAVE_REMOTE_LCD) /* HAVE_REMOTE_LCD */ + extern struct frame_buffer_t lcd_remote_framebuffer_default; + if (screen == SCREEN_REMOTE) + { + memcpy(backdrops[i].buffer, + lcd_remote_framebuffer_default.data, REMOTE_LCD_BACKDROP_BYTES); + } + else +#endif + { + memcpy(backdrops[i].buffer, + lcd_framebuffer_default.data, LCD_BACKDROP_BYTES); + } + } } else retval = false;