summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps-common.c3
-rw-r--r--apps/gui/statusbar.c2
-rw-r--r--apps/menu.c2
-rw-r--r--apps/plugins/battery_bench.c21
-rw-r--r--apps/plugins/firmware_flash.c2
-rw-r--r--apps/plugins/iriver_flash.c2
-rw-r--r--apps/plugins/lamp.c8
-rw-r--r--apps/plugins/rockbox_flash.c2
8 files changed, 26 insertions, 16 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 2b1d6417e2..e218c123f3 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -85,8 +85,7 @@ static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force)
85 if (wps->data->wps_sb_tag) 85 if (wps->data->wps_sb_tag)
86 draw = wps->data->show_sb_on_wps; 86 draw = wps->data->show_sb_on_wps;
87 87
88 if (!draw) 88 viewportmanager_set_statusbar(draw);
89 viewportmanager_set_statusbar(false);
90} 89}
91#else 90#else
92#define gui_wps_statusbar_draw(wps, force) 91#define gui_wps_statusbar_draw(wps, force)
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 29b80112f7..b4e99f8885 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -341,7 +341,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
341 if(!display->has_disk_led && bar->info.led) 341 if(!display->has_disk_led && bar->info.led)
342 gui_statusbar_led(display); 342 gui_statusbar_led(display);
343#endif 343#endif
344 display->update_rect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); 344 display->update_viewport();
345 bar->lastinfo = bar->info; 345 bar->lastinfo = bar->info;
346 } 346 }
347#endif /* HAVE_LCD_BITMAP */ 347#endif /* HAVE_LCD_BITMAP */
diff --git a/apps/menu.c b/apps/menu.c
index b5309a047e..419db3ae3e 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -355,6 +355,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
355 const struct menu_item_ex *temp, *menu; 355 const struct menu_item_ex *temp, *menu;
356 int ret = 0, i; 356 int ret = 0, i;
357 bool redraw_lists; 357 bool redraw_lists;
358 bool oldbars = viewportmanager_set_statusbar(!hide_bars);
358 359
359 const struct menu_item_ex *menu_stack[MAX_MENUS]; 360 const struct menu_item_ex *menu_stack[MAX_MENUS];
360 int menu_stack_selected_item[MAX_MENUS]; 361 int menu_stack_selected_item[MAX_MENUS];
@@ -696,6 +697,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
696 *start_selected = get_menu_selection( 697 *start_selected = get_menu_selection(
697 gui_synclist_get_sel_pos(&lists), menu); 698 gui_synclist_get_sel_pos(&lists), menu);
698 } 699 }
700 viewportmanager_set_statusbar(oldbars);
699 return ret; 701 return ret;
700} 702}
701 703
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 7c67cca937..6559f535af 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -224,6 +224,7 @@ static unsigned int buf_idx;
224 224
225bool exit_tsr(bool reenter) 225bool exit_tsr(bool reenter)
226{ 226{
227 long button;
227 (void)reenter; 228 (void)reenter;
228 rb->lcd_clear_display(); 229 rb->lcd_clear_display();
229 rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running."); 230 rb->lcd_puts_scroll(0, 0, "Batt.Bench is currently running.");
@@ -233,15 +234,21 @@ bool exit_tsr(bool reenter)
233#endif 234#endif
234 rb->lcd_update(); 235 rb->lcd_update();
235 236
236 if (rb->button_get(true) == BATTERY_OFF) 237 while (1)
237 { 238 {
238 rb->queue_post(&thread_q, EV_EXIT, 0); 239 button = rb->button_get(true);
239 rb->thread_wait(thread_id); 240 if (IS_SYSEVENT(button))
240 /* remove the thread's queue from the broadcast list */ 241 continue;
241 rb->queue_delete(&thread_q); 242 if (button == BATTERY_OFF)
242 return true; 243 {
244 rb->queue_post(&thread_q, EV_EXIT, 0);
245 rb->thread_wait(thread_id);
246 /* remove the thread's queue from the broadcast list */
247 rb->queue_delete(&thread_q);
248 return true;
249 }
250 else return false;
243 } 251 }
244 else return false;
245} 252}
246 253
247#define BIT_CHARGER 0x1 254#define BIT_CHARGER 0x1
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c
index 376ae7f80f..6380f6dbdb 100644
--- a/apps/plugins/firmware_flash.c
+++ b/apps/plugins/firmware_flash.c
@@ -592,7 +592,7 @@ int WaitForButton(void)
592 do 592 do
593 { 593 {
594 button = rb->button_get(true); 594 button = rb->button_get(true);
595 } while (button & BUTTON_REL); 595 } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
596 596
597 return button; 597 return button;
598} 598}
diff --git a/apps/plugins/iriver_flash.c b/apps/plugins/iriver_flash.c
index 9f26f82d13..e7ae056d38 100644
--- a/apps/plugins/iriver_flash.c
+++ b/apps/plugins/iriver_flash.c
@@ -230,7 +230,7 @@ int wait_for_button(void)
230 do 230 do
231 { 231 {
232 button = rb->button_get(true); 232 button = rb->button_get(true);
233 } while (button & BUTTON_REL); 233 } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
234 234
235 return button; 235 return button;
236} 236}
diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c
index e355ee4ce3..ace6545865 100644
--- a/apps/plugins/lamp.c
+++ b/apps/plugins/lamp.c
@@ -110,6 +110,7 @@ static int colorset[NUM_COLORSETS][3] = { { 255, 255, 255 } , /* white */
110/* this is the plugin entry point */ 110/* this is the plugin entry point */
111enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) 111enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
112{ 112{
113 long button;
113 (void)parameter; 114 (void)parameter;
114 rb = api; 115 rb = api;
115 116
@@ -167,7 +168,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
167 rb->lcd_clear_display(); 168 rb->lcd_clear_display();
168 rb->lcd_update(); 169 rb->lcd_update();
169 170
170 switch(rb->button_get(true)) 171 switch((button = rb->button_get(true)))
171 { 172 {
172 case LAMP_RIGHT: 173 case LAMP_RIGHT:
173#ifdef LAMP_NEXT 174#ifdef LAMP_NEXT
@@ -196,9 +197,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
196 case (LAMP_PREV|BUTTON_REL): 197 case (LAMP_PREV|BUTTON_REL):
197#endif /* LAMP_PREV */ 198#endif /* LAMP_PREV */
198 /* eat these... */ 199 /* eat these... */
199 break; 200 break;
200 default: 201 default:
201 quit = true; 202 if (!IS_SYSEVENT(button))
203 quit = true;
202 } 204 }
203 } while (!quit); 205 } while (!quit);
204 206
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
index 6323ca9736..d0dc73875e 100644
--- a/apps/plugins/rockbox_flash.c
+++ b/apps/plugins/rockbox_flash.c
@@ -516,7 +516,7 @@ static int WaitForButton(void)
516 do 516 do
517 { 517 {
518 button = rb->button_get(true); 518 button = rb->button_get(true);
519 } while (button & BUTTON_REL); 519 } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
520 520
521 return button; 521 return button;
522} 522}