Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (Revision 20400) +++ apps/gui/gwps-common.c (Arbeitskopie) @@ -1898,6 +1898,15 @@ } } +static inline void reset_sublines(struct wps_data *data) +{ + int i; + for (i = 0; i <= data->num_lines; i++) + { + data->lines[i].curr_subline = SUBLINE_RESET; + } +} + /* Refresh the WPS according to refresh_mode. */ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, @@ -1935,18 +1944,63 @@ #endif +#ifdef HAVE_BACKLIGHT + if (global_settings.caption_backlight && state->id3) + { + /* 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 && state->id3) + { + /* 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 + && !is_remote_backlight_on() +#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++) { @@ -2113,38 +2167,5 @@ display->update(); -#ifdef HAVE_BACKLIGHT - if (global_settings.caption_backlight && state->id3) - { - /* 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 && state->id3) - { - /* 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 return true; } Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 20400) +++ 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); @@ -656,8 +670,12 @@ break; case ACTION_REDRAW: /* yes are locked, just redraw */ - restore = true; - break; + { + debugf("ACTION_REDRAW"); + FOR_NB_SCREENS(i) + gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL); + } + break; case ACTION_NONE: /* Timeout */ update_track = true; ffwd_rew(button); /* hopefully fix the ffw/rwd bug */ @@ -700,6 +718,9 @@ #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_wps_backdrop(); #endif +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + lcd_activation_set_hook(wps_set_lcd_activation_hook); +#endif restore = false; restoretimer = RESTORE_WPS_INSTANTLY; if (gui_wps_display()) {