From 965e824923e63b6fd53113ed4c4c2c04692b2fe4 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Thu, 18 May 2006 22:00:28 +0000 Subject: [PATCH] Check if backdrop available at wps load. Clear old backdrop pointer when the user has removed it while being in the menu. Fixes bug 5351 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9961 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps.c | 12 +++++++++++- apps/tree.c | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 7c9bbc63d2..b84027c61c 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -106,9 +106,16 @@ long gui_wps_show(void) } #ifdef HAVE_LCD_COLOR gui_wps[SCREEN_MAIN].data->old_backdrop = lcd_get_backdrop(); - if (gui_wps[SCREEN_MAIN].data->has_backdrop) { + if (gui_wps[SCREEN_MAIN].data->has_backdrop) + { lcd_set_backdrop(&wps_backdrop[0][0]); } + else + { + /* wps has no backdrop, so clear it in case we're switching wps */ + lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop); + } + #endif #endif @@ -555,6 +562,9 @@ long gui_wps_show(void) if (main_menu()) return true; #ifdef HAVE_LCD_COLOR + if(global_settings.backdrop_file[0] == 0) + gui_wps[SCREEN_MAIN].data->old_backdrop = NULL; + if (gui_wps[SCREEN_MAIN].data->has_backdrop) lcd_set_backdrop(&wps_backdrop[0][0]); #endif diff --git a/apps/tree.c b/apps/tree.c index 435ea8880a..6141a000bd 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -889,7 +889,11 @@ static bool dirbrowse(void) if (gui_wps_show() == SYS_USB_CONNECTED) reload_dir = true; #ifdef HAVE_LCD_COLOR - lcd_set_backdrop(old_backdrop); + /* check if the backdrop hasn't been cleared */ + if(global_settings.backdrop_file[0]) + lcd_set_backdrop(old_backdrop); + else + lcd_set_backdrop(NULL); #endif #ifdef HAVE_HOTSWAP else