diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-01-22 16:58:47 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-22 16:58:58 +0100 |
commit | 6cb11764e001e8d4d8417c8f5c93e4168d4b3267 (patch) | |
tree | 93126658f1ed0316a0c79275d2f8afede3730c10 | |
parent | 6022d3100a31266d48d89c4eaa562ed58a1f1909 (diff) | |
download | rockbox-6cb11764e001e8d4d8417c8f5c93e4168d4b3267.tar.gz rockbox-6cb11764e001e8d4d8417c8f5c93e4168d4b3267.zip |
skin_engine/backdrops: Have to reload default backdrops from setting when it changed.
When skins use the default backdrop (via %X(-) or no %X at all) and the setting
changes it needs to be reloaded, otherwise when changing themes the new theme
could show the backdrop from the previous theme. The same needs to be
done when re-selecting the same theme after USB because the backdrop file was
potentially overwritten.
Fixes FS#12892 and FS#12942.
Change-Id: Ic2d20740cc385fa99667ce8a71507dbda2efceaf
-rw-r--r-- | apps/gui/skin_engine/skin_backdrops.c | 4 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_engine.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c index 4d0345c21d..8962b5113f 100644 --- a/apps/gui/skin_engine/skin_backdrops.c +++ b/apps/gui/skin_engine/skin_backdrops.c | |||
@@ -178,18 +178,18 @@ bool skin_backdrops_preload(void) | |||
178 | if (backdrops[i].buflib_handle > 0) | 178 | if (backdrops[i].buflib_handle > 0) |
179 | { | 179 | { |
180 | backdrops[i].buffer = core_get_data(backdrops[i].buflib_handle); | 180 | backdrops[i].buffer = core_get_data(backdrops[i].buflib_handle); |
181 | handle_being_loaded = backdrops[i].buflib_handle; | ||
182 | if (strcmp(filename, BACKDROP_BUFFERNAME)) | 181 | if (strcmp(filename, BACKDROP_BUFFERNAME)) |
183 | { | 182 | { |
183 | handle_being_loaded = backdrops[i].buflib_handle; | ||
184 | backdrops[i].loaded = | 184 | backdrops[i].loaded = |
185 | screens[screen].backdrop_load(filename, backdrops[i].buffer); | 185 | screens[screen].backdrop_load(filename, backdrops[i].buffer); |
186 | handle_being_loaded = -1; | ||
187 | if (!backdrops[i].loaded) | 186 | if (!backdrops[i].loaded) |
188 | { | 187 | { |
189 | core_free(backdrops[i].buflib_handle); | 188 | core_free(backdrops[i].buflib_handle); |
190 | backdrops[i].buflib_handle = -1; | 189 | backdrops[i].buflib_handle = -1; |
191 | retval = false; | 190 | retval = false; |
192 | } | 191 | } |
192 | handle_being_loaded = -1; | ||
193 | } | 193 | } |
194 | else | 194 | else |
195 | backdrops[i].loaded = true; | 195 | backdrops[i].loaded = true; |
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c index bf284b7a79..b5178cc798 100644 --- a/apps/gui/skin_engine/skin_engine.c +++ b/apps/gui/skin_engine/skin_engine.c | |||
@@ -181,6 +181,9 @@ void settings_apply_skins(void) | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | first_run = false; | 183 | first_run = false; |
184 | /* any backdrop that was loaded with "-" has to be reloaded because | ||
185 | * the setting may have changed */ | ||
186 | skin_backdrop_load_setting(); | ||
184 | viewportmanager_theme_changed(THEME_STATUSBAR); | 187 | viewportmanager_theme_changed(THEME_STATUSBAR); |
185 | #ifdef HAVE_BACKDROP_IMAGE | 188 | #ifdef HAVE_BACKDROP_IMAGE |
186 | FOR_NB_SCREENS(i) | 189 | FOR_NB_SCREENS(i) |