Index: apps/action.h =================================================================== --- apps/action.h (Revision 20338) +++ apps/action.h (Arbeitskopie) @@ -127,6 +127,10 @@ ACTION_WPS_ABSETA_PREVDIR, /* these should be safe to put together seen as */ ACTION_WPS_ABSETB_NEXTDIR, /* you shouldnt want to change dir in ab-mode */ ACTION_WPS_ABRESET, +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + ACTION_WPS_UPDATE, +#endif + /* list and tree page up/down */ ACTION_LISTTREE_PGUP,/* optional */ Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (Revision 20338) +++ apps/gui/gwps-common.c (Arbeitskopie) @@ -1945,18 +1945,75 @@ #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) + bool no_update = true; + if (!lcd_active() +#ifdef HAVE_REMOTE_LCD + && !is_remote_backlight_on() +#endif + ) + { + no_update = false; + /* reset sublines to avoid fast subline changing when backlight is + * on again */ + goto reset_sublines; + } +#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(); +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) +reset_sublines: +#endif for (i = 0; i <= data->num_lines; i++) { data->lines[i].curr_subline = SUBLINE_RESET; } +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + if (no_update) + return true; +#endif } + #ifdef HAVE_LCD_CHARCELLS for (i = 0; i < 8; i++) { @@ -2119,39 +2176,6 @@ 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 /* force a bars update if they are being displayed */ viewportmanager_draw_statusbars(NULL); return true; Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 20338) +++ 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_WPS_UPDATE, 0); +} +#endif + void gwps_fix_statusbars(void) { #ifdef HAVE_LCD_BITMAP @@ -173,6 +180,7 @@ static void gwps_leave_wps(void) { int oldbars = VP_SB_HIDE_ALL; + if (global_settings.statusbar) oldbars = VP_SB_ALLSCREENS; @@ -184,6 +192,9 @@ #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_main_backdrop(); #endif +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + lcd_activation_set_hook(NULL); +#endif } /* The WPS can be left in two ways: @@ -209,6 +220,10 @@ wps_state_init(); gwps_fix_statusbars(); +#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); @@ -332,6 +347,12 @@ #endif switch(button) { +#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) + case ACTION_WPS_UPDATE: + FOR_NB_SCREENS(i) + gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL); + break; +#endif case ACTION_WPS_CONTEXT: { gwps_leave_wps(); @@ -692,6 +713,9 @@ show_remote_wps_backdrop(); #endif viewportmanager_set_statusbar(wpsbars); +#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()) {