Index: apps/screens.c =================================================================== --- apps/screens.c (revision 19614) +++ apps/screens.c (working copy) @@ -138,7 +138,6 @@ screens[i].update(); } - gui_syncstatusbar_draw(&statusbars, true); #ifdef SIMULATOR while (button_get(true) & BUTTON_REL); #else @@ -355,7 +354,6 @@ remote_backlight_set_timeout(global_settings.remote_backlight_timeout); #endif backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); - gui_syncstatusbar_draw(&statusbars, true); #ifdef HAVE_LCD_CHARCELLS logo_lock_patterns(true); @@ -584,7 +582,6 @@ screens[s].update_viewport(); screens[s].set_viewport(NULL); } - gui_syncstatusbar_draw(&statusbars, true); /* set the most common numbers */ min = 0; @@ -841,9 +838,7 @@ gui_synclist_init(&id3_lists, &id3_get_info, &info, true, 2, NULL); gui_synclist_set_nb_items(&id3_lists, info.count*2); gui_synclist_draw(&id3_lists); - gui_syncstatusbar_draw(&statusbars, true); while (true) { - gui_syncstatusbar_draw(&statusbars, false); key = get_action(CONTEXT_LIST,HZ/2); if(key!=ACTION_NONE && key!=ACTION_UNKNOWN && !gui_synclist_do_button(&id3_lists, &key,LIST_WRAP_UNLESS_HELD)) @@ -902,6 +897,7 @@ gui_synclist_set_icon_callback(&lists, NULL); gui_synclist_set_nb_items(&lists, 4); gui_synclist_speak_item(&lists); + gui_synclist_draw(&lists); while(1) { #if CONFIG_CHARGING @@ -915,8 +911,6 @@ global_status.runtime += ((current_tick - lasttime) / HZ); } lasttime = current_tick; - gui_synclist_draw(&lists); - gui_syncstatusbar_draw(&statusbars, true); list_do_action(CONTEXT_STD, HZ, &lists, &action, LIST_WRAP_UNLESS_HELD); if(action == ACTION_STD_CANCEL) Index: apps/recorder/radio.c =================================================================== --- apps/recorder/radio.c (revision 19614) +++ apps/recorder/radio.c (working copy) @@ -489,7 +489,6 @@ /* always display status bar in radio screen for now */ global_status.statusbar_forced = statusbar?0:1; global_settings.statusbar = true; - gui_syncstatusbar_draw(&statusbars,true); FOR_NB_SCREENS(i) { viewport_set_defaults(&vp[i], i); @@ -986,8 +985,6 @@ gui_buttonbar_draw(&buttonbar); #endif } - /* Only force the redraw if update_screen is true */ - gui_syncstatusbar_draw(&statusbars,true); } update_screen = false; @@ -1027,7 +1024,6 @@ if(audio_status() & AUDIO_STATUS_ERROR) { splash(0, str(LANG_DISK_FULL)); - gui_syncstatusbar_draw(&statusbars,true); FOR_NB_SCREENS(i) { screens[i].set_viewport(&vp[i]); @@ -1397,7 +1393,6 @@ while (result == 0) { gui_synclist_draw(&lists); - gui_syncstatusbar_draw(&statusbars, true); list_do_action(CONTEXT_STD, TIMEOUT_BLOCK, &lists, &action, LIST_WRAP_UNLESS_HELD); switch (action) Index: apps/recorder/keyboard.c =================================================================== --- apps/recorder/keyboard.c (revision 19614) +++ apps/recorder/keyboard.c (working copy) @@ -743,7 +743,6 @@ sc->set_drawmode(DRMODE_SOLID); } - gui_syncstatusbar_draw(&statusbars, true); FOR_NB_SCREENS(l) screens[l].update(); @@ -1190,7 +1189,6 @@ #endif /* !defined (KBD_MODES) || defined (KBD_CURSOR_KEYS) */ case BUTTON_NONE: - gui_syncstatusbar_draw(&statusbars, false); #ifdef KBD_MORSE_INPUT if (morse_reading) { Index: apps/recorder/recording.c =================================================================== --- apps/recorder/recording.c (revision 19614) +++ apps/recorder/recording.c (working copy) @@ -1024,7 +1024,6 @@ bool statusbar = global_settings.statusbar; global_status.statusbar_forced = statusbar?0:1; global_settings.statusbar = true; - gui_syncstatusbar_draw(&statusbars,true); #endif static const unsigned char *byte_units[] = { @@ -1088,7 +1087,7 @@ /* top vp, 4 lines, force sys font if total screen < 6 lines NOTE: one could limit the list to 1 line and get away with 5 lines */ v = &vp_top[i]; - viewport_set_defaults(v, i); /*already takes care of statusbar*/ + viewport_set_defaults(v, i); if (viewport_get_nb_lines(v) < 4) { /* compact needs 4 lines total */ @@ -1832,7 +1831,6 @@ /* draw peakmeter again (check if this can be removed) */ FOR_NB_ACTIVE_SCREENS(i) { - screens[i].set_viewport(NULL); gui_statusbar_draw(&(statusbars.statusbars[i]), true); screens[i].set_viewport(&vp_top[i]); peak_meter_screen(&screens[i], pm_x[i], pm_y[i], pm_h[i]); @@ -1850,7 +1848,6 @@ if (audio_stat & AUDIO_STATUS_ERROR) { splash(0, str(LANG_DISK_FULL)); - gui_syncstatusbar_draw(&statusbars, true); FOR_NB_SCREENS(i) screens[i].update(); Index: apps/tree.c =================================================================== --- apps/tree.c (revision 19614) +++ apps/tree.c (working copy) @@ -473,7 +473,6 @@ #endif gui_synclist_draw(&tree_lists); gui_synclist_speak_item(&tree_lists); - gui_syncstatusbar_draw(&statusbars, true); return tc.filesindir; } @@ -600,7 +599,7 @@ { int numentries=0; char buf[MAX_PATH]; - unsigned button, oldbutton; + int button, oldbutton; bool reload_root = false; int lastfilter = *tc.dirfilter; bool lastsortcase = global_settings.sort_case; @@ -797,10 +796,6 @@ break; } - case ACTION_NONE: - gui_syncstatusbar_draw(&statusbars, false); - break; - #ifdef HAVE_HOTSWAP case SYS_FS_CHANGED: #ifdef HAVE_TAGCACHE Index: apps/plugins/keybox.c =================================================================== --- apps/plugins/keybox.c (revision 19614) +++ apps/plugins/keybox.c (working copy) @@ -556,7 +556,6 @@ while (!done) { - rb->gui_syncstatusbar_draw(rb->statusbars, true); rb->gui_synclist_draw(&kb_list); button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); if (rb->gui_synclist_do_button(&kb_list, &button, LIST_WRAP_ON)) Index: apps/plugins/zxbox/zxbox_keyb.c =================================================================== --- apps/plugins/zxbox/zxbox_keyb.c (revision 19614) +++ apps/plugins/zxbox/zxbox_keyb.c (working copy) @@ -443,8 +443,6 @@ rb->screens[l]->set_drawmode(DRMODE_SOLID); } - -/* gui_syncstatusbar_draw(&statusbars, true);*/ FOR_NB_SCREENS(l) rb->screens[l]->update(); @@ -554,11 +552,7 @@ } break; - case BUTTON_NONE: - /*gui_syncstatusbar_draw(&statusbars, false);*/ - break; - default: if(rb->default_event_handler(button) == SYS_USB_CONNECTED) FOR_NB_SCREENS(l) Index: apps/plugins/chessbox/chessbox_pgn.c =================================================================== --- apps/plugins/chessbox/chessbox_pgn.c (revision 19614) +++ apps/plugins/chessbox/chessbox_pgn.c (working copy) @@ -640,7 +640,6 @@ rb->gui_synclist_select_item(&games_list, 0); while (true) { - rb->gui_syncstatusbar_draw(rb->statusbars, true); rb->gui_synclist_draw(&games_list); curr_selection = rb->gui_synclist_get_sel_pos(&games_list); button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); Index: apps/plugins/calendar.c =================================================================== --- apps/plugins/calendar.c (revision 19614) +++ apps/plugins/calendar.c (working copy) @@ -674,7 +674,6 @@ while (!exit) { - rb->gui_syncstatusbar_draw(rb->statusbars, true); button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); rb->gui_synclist_do_button(&gui_memos,&button,LIST_WRAP_UNLESS_HELD); Index: apps/plugins/star.c =================================================================== --- apps/plugins/star.c (revision 19614) +++ apps/plugins/star.c (working copy) @@ -1008,9 +1008,6 @@ FOR_NB_SCREENS(selection) { rb->viewport_set_defaults(&vp[selection], selection); - /* we are hiding the statusbar so fix the height also */ - vp[selection].y = 0; - vp[selection].height = rb->screens[selection]->lcdheight; #if LCD_DEPTH > 1 if (rb->screens[selection]->depth > 1) { @@ -1112,7 +1109,6 @@ level--; star_run_game(level); } - return PLUGIN_OK; } Index: apps/plugins/shortcuts/shortcuts_view.c =================================================================== --- apps/plugins/shortcuts/shortcuts_view.c (revision 19614) +++ apps/plugins/shortcuts/shortcuts_view.c (working copy) @@ -58,8 +58,6 @@ rb->gui_synclist_draw(&gui_sc); while (true) { - /* draw the statusbar, should be done often */ - rb->gui_syncstatusbar_draw(rb->statusbars, true); /* user input */ button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); if (rb->gui_synclist_do_button(&gui_sc, &button, Index: apps/plugins/lib/oldmenuapi.c =================================================================== --- apps/plugins/lib/oldmenuapi.c (revision 19614) +++ apps/plugins/lib/oldmenuapi.c (working copy) @@ -98,7 +98,6 @@ int key; rb->gui_synclist_draw(&(menus[m].synclist)); - rb->gui_syncstatusbar_draw(rb->statusbars, true); while (!exit) { key = rb->get_action(CONTEXT_MAINMENU,HZ/2); /* @@ -126,7 +125,6 @@ return MENU_ATTACHED_USB; break; } - rb->gui_syncstatusbar_draw(rb->statusbars, false); } return MENU_SELECTED_EXIT; } @@ -149,7 +147,6 @@ if (menus[m].items[selected].function && menus[m].items[selected].function()) return true; - rb->gui_syncstatusbar_draw(rb->statusbars, true); } } } Index: apps/onplay.c =================================================================== --- apps/onplay.c (revision 19614) +++ apps/onplay.c (working copy) @@ -212,7 +212,6 @@ if (global_settings.playlist_shuffle) playlist_shuffle(current_tick, -1); playlist_start(0,0); - gui_syncstatusbar_draw(&statusbars, false); onplay_result = ONPLAY_START_PLAY; } Index: apps/gui/bitmap/list.c =================================================================== --- apps/gui/bitmap/list.c (revision 19614) +++ apps/gui/bitmap/list.c (working copy) @@ -295,7 +295,7 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list, struct viewport *parent) { short x, y; - unsigned button = action_get_touchscreen_press(&x, &y); + int button = action_get_touchscreen_press(&x, &y); int line; struct screen *display = &screens[SCREEN_MAIN]; if (button == BUTTON_NONE) Index: apps/gui/yesno.c =================================================================== --- apps/gui/yesno.c (revision 19614) +++ apps/gui/yesno.c (working copy) @@ -131,7 +131,7 @@ const struct text_message * no_message) { int i; - unsigned button; + int button; int result=-1; bool result_displayed; struct gui_yesno yn[NB_SCREENS]; Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (revision 19614) +++ apps/gui/gwps-common.c (working copy) @@ -61,6 +61,7 @@ #include "playback.h" #endif #include "backdrop.h" +#include "viewport.h" #define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ /* 3% of 30min file == 54s step size */ @@ -78,17 +79,17 @@ #ifdef HAVE_LCD_BITMAP static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) { + (void)force; bool draw = global_settings.statusbar; if (wps->data->wps_sb_tag) draw = wps->data->show_sb_on_wps; - if (draw) - gui_statusbar_draw(wps->statusbar, force); + if (!draw) + viewportmanager_set_statusbar(false); } #else -#define gui_wps_statusbar_draw(wps, force) \ - gui_statusbar_draw((wps)->statusbar, (force)) +#define gui_wps_statusbar_draw(wps, force) #endif #include "pcmbuf.h" @@ -335,9 +336,6 @@ if (!wps_state.id3 && !(audio_status() & AUDIO_STATUS_PLAY)) { global_status.resume_index = -1; -#ifdef HAVE_LCD_BITMAP - gui_syncstatusbar_draw(&statusbars, true); -#endif splash(HZ, ID2P(LANG_END_PLAYLIST)); return true; } Index: apps/gui/pitchscreen.c =================================================================== --- apps/gui/pitchscreen.c (revision 19614) +++ apps/gui/pitchscreen.c (working copy) @@ -286,7 +286,6 @@ FOR_NB_SCREENS(i) pitchscreen_draw(&screens[i], max_lines[i], pitch_viewports[i], pitch); - gui_syncstatusbar_draw(&statusbars, true); button = get_action(CONTEXT_PITCHSCREEN,HZ); switch (button) { case ACTION_PS_INC_SMALL: Index: apps/gui/option_select.c =================================================================== --- apps/gui/option_select.c (revision 19614) +++ apps/gui/option_select.c (working copy) @@ -508,7 +508,6 @@ gui_synclist_draw(&lists); /* talk the item */ gui_synclist_speak_item(&lists); - gui_syncstatusbar_draw(&statusbars, false); while (!done) { if (list_do_action(CONTEXT_LIST, TIMEOUT_BLOCK, @@ -562,7 +561,6 @@ } else if(default_event_handler(action) == SYS_USB_CONNECTED) return true; - gui_syncstatusbar_draw(&statusbars, false); /* callback */ if ( function ) function(*variable); Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 19614) +++ apps/gui/list.c (working copy) @@ -582,7 +582,7 @@ #endif bool gui_synclist_do_button(struct gui_synclist * lists, - unsigned *actionptr, enum list_wrap wrap) + int *actionptr, enum list_wrap wrap) { int action = *actionptr; #ifdef HAVE_LCD_BITMAP @@ -888,7 +888,6 @@ while(1) { - gui_syncstatusbar_draw(&statusbars, true); list_do_action(CONTEXT_STD, info->timeout, &lists, &action, wrap); Index: apps/gui/quickscreen.c =================================================================== --- apps/gui/quickscreen.c (revision 19614) +++ apps/gui/quickscreen.c (working copy) @@ -278,7 +278,6 @@ * - an action taken while pressing the enter button, * then release the enter button*/ bool can_quit = false; - gui_syncstatusbar_draw(&statusbars, true); FOR_NB_SCREENS(i) { screens[i].set_viewport(NULL); @@ -315,8 +314,6 @@ if(button==ACTION_STD_CANCEL) break; - - gui_syncstatusbar_draw(&statusbars, false); } /* Notify that we're exiting this screen */ cond_talk_ids_fq(VOICE_OK); Index: apps/gui/viewport.c =================================================================== --- apps/gui/viewport.c (revision 19614) +++ apps/gui/viewport.c (working copy) @@ -34,6 +34,8 @@ #include "statusbar.h" #include "screen_access.h" +static bool statusbar_enabled = true; + int viewport_get_nb_lines(struct viewport *vp) { #ifdef HAVE_LCD_BITMAP @@ -50,7 +52,7 @@ vp->x = 0; vp->width = screens[screen].lcdwidth; - vp->y = gui_statusbar_height(); + vp->y = statusbar_enabled?gui_statusbar_height():0; vp->height = screens[screen].lcdheight - vp->y; #ifdef HAVE_LCD_BITMAP vp->drawmode = DRMODE_SOLID; @@ -82,3 +84,16 @@ } #endif } + +void viewportmanager_set_statusbar(bool enabled) +{ + if (statusbar_enabled != enabled) + viewportmanager_draw_statusbars(); + statusbar_enabled = enabled; +} + +void viewportmanager_draw_statusbars(void) +{ + if (statusbar_enabled) + gui_syncstatusbar_draw(&statusbars, true); +} Index: apps/gui/list.h =================================================================== --- apps/gui/list.h (revision 19614) +++ apps/gui/list.h (working copy) @@ -179,7 +179,7 @@ * NOTE: *action may be changed regardless of return value */ extern bool gui_synclist_do_button(struct gui_synclist * lists, - unsigned *action, + int *action, enum list_wrap); /* If the list has a pending postponed scheduled announcement, that Index: apps/gui/viewport.h =================================================================== --- apps/gui/viewport.h (revision 19614) +++ apps/gui/viewport.h (working copy) @@ -40,3 +40,7 @@ int viewport_load_config(const char *config, struct viewport *vp); void viewport_set_defaults(struct viewport *vp, enum screen_type screen); + +void viewportmanager_set_statusbar(bool enabled); +void viewportmanager_draw_statusbars(void); + Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (revision 19614) +++ apps/gui/wps_parser.c (working copy) @@ -384,6 +384,7 @@ wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; wps_data->viewports[0].vp.height -= STATUSBAR_HEIGHT; } + viewportmanager_set_statusbar(true); return skip_end_of_line(wps_bufptr); } @@ -399,6 +400,8 @@ wps_data->viewports[0].vp.y = 0; wps_data->viewports[0].vp.height += STATUSBAR_HEIGHT; } + /* dont let the background updater update the stausbars */ + viewportmanager_set_statusbar(false); return skip_end_of_line(wps_bufptr); } Index: apps/menu.c =================================================================== --- apps/menu.c (revision 19614) +++ apps/menu.c (working copy) @@ -436,7 +436,6 @@ #ifdef HAVE_BUTTONBAR gui_buttonbar_draw(&buttonbar); #endif - gui_syncstatusbar_draw(&statusbars, true); } action = get_action(CONTEXT_MAINMENU, list_do_action_timeout(&lists, HZ)); Index: apps/menus/recording_menu.c =================================================================== --- apps/menus/recording_menu.c (revision 19614) +++ apps/menus/recording_menu.c (working copy) @@ -537,7 +537,6 @@ if (changed) { gui_synclist_draw(&lists); - gui_syncstatusbar_draw(&statusbars, true); peak_meter_trigger(global_settings.rec_trigger_mode!=TRIG_OFF); settings_apply_trigger(); changed = false; Index: apps/alarm_menu.c =================================================================== --- apps/alarm_menu.c (revision 19614) +++ apps/alarm_menu.c (working copy) @@ -193,7 +193,6 @@ break; case ACTION_NONE: - gui_syncstatusbar_draw(&statusbars, false); hour_wrapped = false; break; Index: apps/playlist_viewer.c =================================================================== --- apps/playlist_viewer.c (revision 19614) +++ apps/playlist_viewer.c (working copy) @@ -746,10 +746,6 @@ gui_synclist_draw(&playlist_lists); break; - case ACTION_NONE: - gui_syncstatusbar_draw(&statusbars, false); - break; - default: if(default_event_handler(button) == SYS_USB_CONNECTED) { @@ -834,7 +830,6 @@ gui_synclist_draw(&playlist_lists); while (!exit) { - gui_syncstatusbar_draw(&statusbars, false); button = get_action(CONTEXT_LIST, HZ/4); if (gui_synclist_do_button(&playlist_lists, &button, LIST_WRAP_UNLESS_HELD)) continue; Index: apps/enc_config.c =================================================================== --- apps/enc_config.c (revision 19614) +++ apps/enc_config.c (working copy) @@ -295,7 +295,6 @@ encoder_config_to_global(data->cfg); } - gui_syncstatusbar_draw(&statusbars, true); } return action; } Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 19614) +++ apps/plugin.c (working copy) @@ -621,6 +621,7 @@ appsversion, /* new stuff at the end, sort into place next time the API gets incompatible */ + viewportmanager_set_statusbar, }; int plugin_load(const char* plugin, const void* parameter) @@ -731,8 +732,11 @@ #endif invalidate_icache(); + viewportmanager_set_statusbar(false); rc = hdr->entry_point(&rockbox_api, parameter); + + viewportmanager_set_statusbar(true); button_clear_queue(); Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 19614) +++ apps/plugin.h (working copy) @@ -7,7 +7,7 @@ * \/ \/ \/ \/ \/ * $Id$ * - * Copyright (C) 2002 Björn Stenberg + * Copyright (C) 2002 Bj�rn Stenberg * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -132,7 +132,7 @@ #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 131 +#define PLUGIN_API_VERSION 132 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any @@ -334,7 +334,7 @@ void (*gui_synclist_del_item)(struct gui_synclist * lists); void (*gui_synclist_limit_scroll)(struct gui_synclist * lists, bool scroll); bool (*gui_synclist_do_button)(struct gui_synclist * lists, - unsigned *action, enum list_wrap wrap); + int *action, enum list_wrap wrap); void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, int icon); enum yesno_res (*gui_syncyesno_run)(const struct text_message * main_message, const struct text_message * yes_message, @@ -785,6 +785,7 @@ const char *appsversion; /* new stuff at the end, sort into place next time the API gets incompatible */ + void (*viewportmanager_set_statusbar)(bool enabled); }; /* plugin header */ Index: apps/bookmark.c =================================================================== --- apps/bookmark.c (revision 19614) +++ apps/bookmark.c (working copy) @@ -198,7 +198,6 @@ #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_main_backdrop(); #endif - gui_syncstatusbar_draw(&statusbars, false); if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES) { if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK) @@ -680,11 +679,9 @@ gui_synclist_set_voice_callback(&list, bookmark_list_voice_cb); gui_synclist_set_title(&list, str(LANG_BOOKMARK_SELECT_BOOKMARK), Icon_Bookmark); - gui_syncstatusbar_draw(&statusbars, true); while (!exit) { - gui_syncstatusbar_draw(&statusbars, false); if (refresh) { Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (revision 19614) +++ apps/root_menu.c (working copy) @@ -46,6 +46,7 @@ #include "buttonbar.h" #include "action.h" #include "yesno.h" +#include "viewport.h" #include "tree.h" #if CONFIG_TUNER @@ -117,7 +118,6 @@ /* Now display progress until it's ready or the user exits */ while(!tagcache_is_usable()) { - gui_syncstatusbar_draw(&statusbars, false); struct tagcache_stat *stat = tagcache_get_stat(); /* Allow user to exit */ @@ -262,6 +262,8 @@ #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 show_remote_main_backdrop(); #endif + /* always re-enable the statusbar after the WPS */ + viewportmanager_set_statusbar(true); return ret_val; } #if CONFIG_TUNER Index: apps/debug_menu.c =================================================================== --- apps/debug_menu.c (revision 19614) +++ apps/debug_menu.c (working copy) @@ -47,6 +47,7 @@ #include "misc.h" #include "splash.h" #include "dircache.h" +#include "viewport.h" #ifdef HAVE_TAGCACHE #include "tagcache.h" #endif @@ -232,6 +233,7 @@ struct audio_debug d; lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(1) { @@ -269,6 +271,7 @@ lcd_update(); } + viewportmanager_set_statusbar(true); return false; } #endif /* !SIMULATOR */ @@ -304,6 +307,7 @@ tick_add_task(dbg_audio_task); lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(!done) { button = get_action(CONTEXT_STD,HZ/5); @@ -394,6 +398,7 @@ } tick_remove_task(dbg_audio_task); + viewportmanager_set_statusbar(true); return false; } @@ -526,6 +531,7 @@ lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); + viewportmanager_set_statusbar(false); lcd_puts(0, 0, "[Hardware info]"); @@ -564,6 +570,7 @@ int got_id; /* flag if we managed to get the flash IDs */ int oldmode; /* saved memory guard mode */ int line = 0; + viewportmanager_set_statusbar(false); oldmode = system_memory_guard(MEMGUARD_NONE); /* disable memory guard */ @@ -626,6 +633,7 @@ lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); + viewportmanager_set_statusbar(false); lcd_puts(0, line++, "[Hardware info]"); @@ -679,10 +687,12 @@ lcd_update(); while (!(action_userabort(TIMEOUT_BLOCK))); + #else /* Define this function in your target tree */ return __dbg_hw_info(); #endif /* CONFIG_CPU */ + viewportmanager_set_statusbar(true); return false; } #else /* !HAVE_LCD_BITMAP */ @@ -824,6 +834,7 @@ lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); #ifdef HAVE_SPDIF_POWER spdif_power_enable(true); /* We need SPDIF power for both sending & receiving */ @@ -976,6 +987,7 @@ spdif_power_enable(global_settings.spdif_enable); #endif + viewportmanager_set_statusbar(true); return false; } #endif /* CPU_COLDFIRE */ @@ -1033,6 +1045,7 @@ lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); + viewportmanager_set_statusbar(false); while(1) { @@ -1057,7 +1070,10 @@ lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + viewportmanager_set_statusbar(true); return false; + } } #elif defined(CPU_COLDFIRE) unsigned int gpio_out; @@ -1075,6 +1091,7 @@ lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(1) { @@ -1140,7 +1157,10 @@ lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + viewportmanager_set_statusbar(true); return false; + } } #elif defined(CPU_PP502x) @@ -1150,6 +1170,7 @@ lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(1) { @@ -1247,7 +1268,10 @@ #endif lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + viewportmanager_set_statusbar(true); return false; + } } #elif CONFIG_CPU == PP5002 @@ -1256,6 +1280,7 @@ lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(1) { @@ -1286,8 +1311,12 @@ lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) + { + viewportmanager_set_statusbar(true); return false; + } } + viewportmanager_set_statusbar(true); #else return __dbg_ports(); #endif /* CPU */ @@ -1302,6 +1331,7 @@ int currval = 0; lcd_clear_display(); + viewportmanager_set_statusbar(false); while(1) { @@ -1337,7 +1367,6 @@ case 9: snprintf(buf, 32, "AN7: %03x", adc_read(7)); break; - break; } lcd_puts(0, 0, buf); @@ -1367,6 +1396,7 @@ break; } } + viewportmanager_set_statusbar(true); return false; } #endif /* !HAVE_LCD_BITMAP */ @@ -1382,6 +1412,7 @@ lcd_setfont(FONT_SYSFIXED); #endif lcd_clear_display(); + viewportmanager_set_statusbar(false); while(1) { @@ -1417,10 +1448,12 @@ lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) { + viewportmanager_set_statusbar(true); return false; } } + viewportmanager_set_statusbar(true); return false; } #endif @@ -1436,6 +1469,7 @@ lcd_setfont(FONT_SYSFIXED); #endif lcd_clear_display(); + viewportmanager_set_statusbar(false); while(1) { @@ -1467,10 +1501,11 @@ break; case ACTION_STD_CANCEL: + viewportmanager_set_statusbar(true); return false; } } - + viewportmanager_set_statusbar(true); return false; } #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ @@ -1563,6 +1598,7 @@ char buf[32]; lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while(1) { @@ -1803,9 +1839,11 @@ break; case ACTION_STD_CANCEL: + viewportmanager_set_statusbar(true); return false; } } + viewportmanager_set_statusbar(true); return false; } @@ -2434,6 +2472,7 @@ bool done; lcd_setfont(FONT_SYSFIXED); str = cpu_boost_log_getlog_first(); + viewportmanager_set_statusbar(false); while (i < count) { lcd_clear_display(); @@ -2467,6 +2506,7 @@ } get_action(CONTEXT_STD,TIMEOUT_BLOCK); lcd_setfont(FONT_UI); + viewportmanager_set_statusbar(true); return false; } #endif @@ -2485,11 +2525,12 @@ unsigned int speed; lcd_setfont(FONT_SYSFIXED); + viewportmanager_set_statusbar(false); while (1) { if (action_userabort(HZ/10)) - return false; + break; lcd_clear_display(); @@ -2514,6 +2555,7 @@ lcd_update(); } + viewportmanager_set_statusbar(true); return false; } #endif Index: apps/main.c =================================================================== --- apps/main.c (revision 19614) +++ apps/main.c (working copy) @@ -121,6 +121,17 @@ static void init(void); +void fourhertz_tick_task(void) +{ + static long last_fire = 0; + if (global_settings.statusbar && + TIME_AFTER(current_tick, last_fire+HZ/4)) + { + queue_post(&button_queue, SYS_FOURHERTZ, 0); + last_fire = current_tick; + } +} + #ifdef SIMULATOR void app_main(void) #else @@ -138,6 +149,8 @@ #ifdef HAVE_TOUCHSCREEN touchscreen_set_mode(TOUCHSCREEN_BUTTON); #endif + tick_add_task(fourhertz_tick_task); + viewportmanager_set_statusbar(true); root_menu(); } Index: apps/misc.c =================================================================== --- apps/misc.c (revision 19614) +++ apps/misc.c (working copy) @@ -60,6 +60,7 @@ #include "sound.h" #include "playlist.h" #include "yesno.h" +#include "viewport.h" #ifdef IPOD_ACCESSORY_PROTOCOL #include "iap.h" @@ -904,6 +905,9 @@ { switch(event) { + case SYS_FOURHERTZ: + viewportmanager_draw_statusbars(); + break; case SYS_BATTERY_UPDATE: if(global_settings.talk_battery_level) { Index: apps/playlist_catalog.c =================================================================== --- apps/playlist_catalog.c (revision 19614) +++ apps/playlist_catalog.c (working copy) @@ -295,10 +295,6 @@ } break; - case ACTION_NONE: - gui_syncstatusbar_draw(&statusbars, false); - break; - default: if(default_event_handler(button) == SYS_USB_CONNECTED) { Index: firmware/export/kernel.h =================================================================== --- firmware/export/kernel.h (revision 19614) +++ firmware/export/kernel.h (working copy) @@ -80,6 +80,7 @@ #define SYS_CAR_ADAPTER_RESUME MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 1) #define SYS_IAP_PERIODIC MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 2) #define SYS_IAP_HANDLEPKT MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 3) +#define SYS_FOURHERTZ MAKE_SYS_EVENT(SYS_EVENT_CLS_MISC, 4) #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) Index: firmware/drivers/button.c =================================================================== --- firmware/drivers/button.c (revision 19614) +++ firmware/drivers/button.c (working copy) @@ -368,7 +368,6 @@ ev.id = BUTTON_NONE; else button_data = ev.data; - return ev.id; }