diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 68f0ba2cf9..1ff5410cf7 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -208,6 +208,20 @@ static void gwps_fix_statusbars(void) | |||
208 | #endif | 208 | #endif |
209 | } | 209 | } |
210 | 210 | ||
211 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
212 | /* | ||
213 | * If the user is unable to see the wps, because the display is deactivated, | ||
214 | * we surpress updates until the wps gets actived again (the lcd driver will | ||
215 | * call this hook) | ||
216 | * */ | ||
217 | static void wps_lcd_activation_hook(void) | ||
218 | { | ||
219 | /* issue an update */ | ||
220 | wps_state.do_full_update = true; | ||
221 | /* force timeout in wps main loop, so that the update is instantly */ | ||
222 | queue_post(&button_queue, BUTTON_NONE, 0); | ||
223 | } | ||
224 | #endif | ||
211 | 225 | ||
212 | static void gwps_leave_wps(void) | 226 | static void gwps_leave_wps(void) |
213 | { | 227 | { |
@@ -225,6 +239,10 @@ static void gwps_leave_wps(void) | |||
225 | show_remote_main_backdrop(); | 239 | show_remote_main_backdrop(); |
226 | #endif | 240 | #endif |
227 | viewportmanager_set_statusbar(oldbars); | 241 | viewportmanager_set_statusbar(oldbars); |
242 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
243 | /* Play safe and unregister the hook */ | ||
244 | lcd_activation_set_hook(NULL); | ||
245 | #endif | ||
228 | } | 246 | } |
229 | 247 | ||
230 | void gwps_draw_statusbars(void) | 248 | void gwps_draw_statusbars(void) |
@@ -663,8 +681,17 @@ long gui_wps_show(void) | |||
663 | if (wps_state.do_full_update || update) | 681 | if (wps_state.do_full_update || update) |
664 | { | 682 | { |
665 | FOR_NB_SCREENS(i) | 683 | FOR_NB_SCREENS(i) |
684 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
685 | if (lcd_active() | ||
686 | #ifdef HAVE_REMOTE_LCD | ||
687 | /* currently, all remotes are readable without backlight | ||
688 | * so still update those */ | ||
689 | && (i == SCREEN_MAIN) | ||
690 | #endif | ||
691 | ) | ||
692 | #endif | ||
666 | { | 693 | { |
667 | gui_wps_update(&gui_wps[i]); | 694 | gui_wps_update(&gui_wps[i]); |
668 | } | 695 | } |
669 | wps_state.do_full_update = false; | 696 | wps_state.do_full_update = false; |
670 | update = false; | 697 | update = false; |
@@ -677,6 +704,9 @@ long gui_wps_show(void) | |||
677 | restore = false; | 704 | restore = false; |
678 | restoretimer = RESTORE_WPS_INSTANTLY; | 705 | restoretimer = RESTORE_WPS_INSTANTLY; |
679 | gwps_fix_statusbars(); | 706 | gwps_fix_statusbars(); |
707 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
708 | lcd_activation_set_hook(wps_lcd_activation_hook); | ||
709 | #endif | ||
680 | FOR_NB_SCREENS(i) | 710 | FOR_NB_SCREENS(i) |
681 | { | 711 | { |
682 | screens[i].stop_scroll(); | 712 | screens[i].stop_scroll(); |