Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (Revision 20485) +++ apps/gui/gwps-common.c (Arbeitskopie) @@ -1873,6 +1873,15 @@ } } +static void reset_sublines(struct wps_data *data) +{ + int i; + for (i = 0; i <= data->num_lines; i++) + { + data->lines[i].curr_subline = SUBLINE_RESET; + } +} + bool gui_wps_redraw(struct gui_wps *gwps, int ffwd_offset, unsigned refresh_mode) @@ -1911,18 +1920,64 @@ #endif +#ifdef HAVE_BACKLIGHT + if (global_settings.caption_backlight) + { + /* turn on backlight n seconds before track ends, and turn it off n + seconds into the new track. n == backlight_timeout, or 5s */ + int n = global_settings.backlight_timeout * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if (((state->id3->elapsed < 1000) || + ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && + (state->paused == false)) + backlight_on(); + } +#endif +#ifdef HAVE_REMOTE_LCD + if (global_settings.remote_caption_backlight) + { + /* turn on remote backlight n seconds before track ends, and turn it + off n seconds into the new track. n == remote_backlight_timeout, + or 5s */ + int n = global_settings.remote_backlight_timeout * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if (((state->id3->elapsed < 1000) || + ((state->id3->length - state->id3->elapsed) < (unsigned)n)) && + (state->paused == false)) + remote_backlight_on(); + } +#endif + +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + if (!lcd_active() +#ifdef HAVE_REMOTE_LCD + /* currently, all remotes are readable without backlight */ + && (display->screen_type == SCREEN_MAIN) +#endif + ) + { + /* lcd inactive, updates won't be visible, so just return */ + /* reset sublines to avoid fast subline changing when backlight is + * on again */ + reset_sublines(data); + return true; + } +#endif + /* reset to first subline if refresh all flag is set */ if (refresh_mode == WPS_REFRESH_ALL) { display->set_viewport(&data->viewports[0].vp); display->clear_viewport(); - - for (i = 0; i <= data->num_lines; i++) - { - data->lines[i].curr_subline = SUBLINE_RESET; - } + reset_sublines(data); } - + #ifdef HAVE_LCD_CHARCELLS for (i = 0; i < 8; i++) { @@ -2083,38 +2138,5 @@ display->update(); -#ifdef HAVE_BACKLIGHT - if (global_settings.caption_backlight) - { - /* turn on backlight n seconds before track ends, and turn it off n - seconds into the new track. n == backlight_timeout, or 5s */ - int n = global_settings.backlight_timeout * 1000; - - if ( n < 1000 ) - n = 5000; /* use 5s if backlight is always on or off */ - - if (((id3->elapsed < 1000) || - ((id3->length - id3->elapsed) < (unsigned)n)) && - (state->paused == false)) - backlight_on(); - } -#endif -#ifdef HAVE_REMOTE_LCD - if (global_settings.remote_caption_backlight) - { - /* turn on remote backlight n seconds before track ends, and turn it - off n seconds into the new track. n == remote_backlight_timeout, - or 5s */ - int n = global_settings.remote_backlight_timeout * 1000; - - if ( n < 1000 ) - n = 5000; /* use 5s if backlight is always on or off */ - - if (((id3->elapsed < 1000) || - ((id3->length - id3->elapsed) < (unsigned)n)) && - (state->paused == false)) - remote_backlight_on(); - } -#endif return true; } Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 20485) +++ apps/gui/gwps.c (Arbeitskopie) @@ -151,6 +151,13 @@ #endif } +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) +static void wps_set_lcd_activation_hook(void) +{ + queue_post(&button_queue, ACTION_REDRAW, 0); +} +#endif + static void gwps_fix_statusbars(void) { #ifdef HAVE_LCD_BITMAP @@ -169,6 +176,9 @@ #else wpsbars = VP_SB_ALLSCREENS; #endif +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + lcd_activation_set_hook(NULL); +#endif } @@ -216,6 +226,10 @@ long last_left = 0, last_right = 0; wps_state_init(); +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + lcd_activation_set_hook(wps_set_lcd_activation_hook); +#endif + #ifdef HAVE_LCD_CHARCELLS status_set_audio(true); status_set_param(false); @@ -645,8 +659,11 @@ break; case ACTION_REDRAW: /* yes are locked, just redraw */ - restore = true; - break; + { + FOR_NB_SCREENS(i) + gui_wps_redraw(&gui_wps[i], 0, WPS_REFRESH_ALL); + } + break; case ACTION_NONE: /* Timeout */ update_track = true; ffwd_rew(button); /* hopefully fix the ffw/rwd bug */ @@ -684,6 +701,9 @@ { restore = false; restoretimer = RESTORE_WPS_INSTANTLY; +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + lcd_activation_set_hook(wps_set_lcd_activation_hook); +#endif FOR_NB_SCREENS(i) { screens[i].stop_scroll();