summaryrefslogtreecommitdiff
path: root/apps/gui/yesno.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-07-18 10:25:32 +0200
committerThomas Martitz <kugel@rockbox.org>2012-07-18 10:28:08 +0200
commit15775c8badac65ad9d7477a1706c019703c15b47 (patch)
tree8d8fa88d377d8cbca763cdd0cdfda7094fadf6c1 /apps/gui/yesno.c
parentdf9bd8730ce8462324f64c49de0ae51584a19d9e (diff)
downloadrockbox-15775c8badac65ad9d7477a1706c019703c15b47.tar.gz
rockbox-15775c8badac65ad9d7477a1706c019703c15b47.zip
fix erroneous button read in yesno screen and missed buttons in action.c.
If two yesno screens directly follow each other the button release of the first one was incorrectly accepted in the second one. The fix exposed another problem in action.c if action_wait_for_release() is called when no button is actually pressed. The next press was silently eaten. Change-Id: Iaa5f246f7ea1fd775606620a989cdaec74a9305e
Diffstat (limited to 'apps/gui/yesno.c')
-rw-r--r--apps/gui/yesno.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index a2abae33ae..dc0465184d 100644
--- a/apps/gui/yesno.c
+++ b/apps/gui/yesno.c
@@ -169,9 +169,10 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
169 screens[i].stop_scroll(); 169 screens[i].stop_scroll();
170 gui_yesno_draw(&(yn[i])); 170 gui_yesno_draw(&(yn[i]));
171 } 171 }
172
172 /* make sure to eat any extranous keypresses */ 173 /* make sure to eat any extranous keypresses */
173 while (get_action(CONTEXT_STD+99, TIMEOUT_NOBLOCK)) 174 action_wait_for_release();
174 action_wait_for_release(); 175
175 while (result==-1) 176 while (result==-1)
176 { 177 {
177 /* Repeat the question every 5secs (more or less) */ 178 /* Repeat the question every 5secs (more or less) */
@@ -205,6 +206,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
205 result=YESNO_YES; 206 result=YESNO_YES;
206 break; 207 break;
207 case ACTION_NONE: 208 case ACTION_NONE:
209 case ACTION_UNKNOWN:
208 case SYS_CHARGER_DISCONNECTED: 210 case SYS_CHARGER_DISCONNECTED:
209 case SYS_BATTERY_UPDATE: 211 case SYS_BATTERY_UPDATE:
210 /* ignore some SYS events that can happen */ 212 /* ignore some SYS events that can happen */
@@ -233,6 +235,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
233 screens[i].scroll_stop(yn[i].vp); 235 screens[i].scroll_stop(yn[i].vp);
234 viewportmanager_theme_undo(i, true); 236 viewportmanager_theme_undo(i, true);
235 } 237 }
238
236 return(result); 239 return(result);
237} 240}
238 241