1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Index: apps/gui/yesno.c
===================================================================
--- apps/gui/yesno.c  (revision 25691)
+++ apps/gui/yesno.c  (working copy)
@@ -28,6 +28,7 @@
 #include "talk.h"
 #include "settings.h"
 #include "viewport.h"
+#include "debug.h"


 struct gui_yesno
@@ -137,6 +138,9 @@
     struct gui_yesno yn[NB_SCREENS];
     struct viewport vp[NB_SCREENS];
     long talked_tick = 0;
+    bool had_non_release;
+    int btn_raw;
+    
     FOR_NB_SCREENS(i)
     {
         yn[i].main_message=main_message;
@@ -153,6 +157,8 @@
         screens[i].stop_scroll();
         gui_yesno_draw(&(yn[i]));
     }
+    
+    had_non_release = false;
     while (result==-1)
     {
         /* Repeat the question every 5secs (more or less) */
@@ -162,7 +168,21 @@
             talked_tick = current_tick;
             talk_text_message(main_message, false);
         }
+        
         button = get_action(CONTEXT_YESNOSCREEN, HZ*5);
+        
+        if (!had_non_release)
+        {
+            /* If we've had only release events so far, ignore them since   */
+            /* these are probably left over events from the previous screen */
+            get_action_statuscode(&btn_raw);
+            DEBUGF("***** Action: %d (%x)   Button: %d (%x)\n", button, button, btn_raw, btn_raw);
+            if (btn_raw & BUTTON_REL)
+                button = ACTION_NONE;
+            else
+                had_non_release = true;
+        }
+        
         switch (button)
         {
             case ACTION_YESNO_ACCEPT: