Move hidden_row to -2; don't re-timeout once a key is pressed
authorH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:12:51 +0000 (17:12 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 25 Jul 2007 00:12:51 +0000 (17:12 -0700)
README.menu
com32/modules/menumain.c

index cf5882d..d9a156c 100644 (file)
@@ -286,7 +286,7 @@ MENU PASSWORDROW 11
 MENU TIMEOUTROW 20
 MENU HELPMSGROW 22
 MENU HELPMSGENDROW -1
-MENU HIDDENROW 20
+MENU HIDDENROW -2
 MENU HSHIFT 0
 MENU VSHIFT 0
 
index e75223f..4282646 100644 (file)
@@ -93,7 +93,7 @@ struct menu_parameter mparm[] = {
   { "helpmsgendrow", -1 },
   { "hshift", 0 },
   { "vshift", 0 },
-  { "hiddenrow", 20 },
+  { "hiddenrow", -2 },
   { NULL, 0 }
 };
 
@@ -793,9 +793,6 @@ run_menu(void)
   const char *cmdline = NULL;
   volatile clock_t key_timeout, timeout_left, this_timeout;
 
-  /* Note: for both key_timeout and timeout == 0 means no limit */
-  timeout_left = key_timeout = timeout;
-
   /* If we're in shiftkey mode, exit immediately unless a shift key is pressed */
   if ( shiftkey && !shift_is_held() ) {
     return menu_entries[defentry].cmdline;
@@ -807,10 +804,15 @@ run_menu(void)
     if (cmdline)
       return cmdline;
 
-    /* Otherwise display the menu now */
+    /* Otherwise display the menu now; the timeout has already been
+       cancelled, since the user pressed a key. */
     hiddenmenu = 0;
+    timeout = 0;
   }
 
+  /* Note: for both key_timeout and timeout == 0 means no limit */
+  timeout_left = key_timeout = timeout;
+
   /* Handle both local and global timeout */
   if ( setjmp(timeout_jump) ) {
     entry = defentry;