[syslinux:master] menu: add MENU CLEAR option
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Wed Feb 3 16:09:02 PST 2010
Commit-ID: cf31931a1afe86c9d3f0871d0ba82d1d788b4774
Gitweb: http://syslinux.zytor.com/commit/cf31931a1afe86c9d3f0871d0ba82d1d788b4774
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Wed, 3 Feb 2010 16:05:59 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Wed, 3 Feb 2010 16:05:59 -0800
menu: add MENU CLEAR option
Add MENU CLEAR to clear the screen on menu exit.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
com32/menu/menu.h | 1 +
com32/menu/menumain.c | 3 +++
com32/menu/readconfig.c | 5 ++++-
doc/menu.txt | 8 ++++++++
4 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/com32/menu/menu.h b/com32/menu/menu.h
index 52b4e4d..1e596e1 100644
--- a/com32/menu/menu.h
+++ b/com32/menu/menu.h
@@ -180,6 +180,7 @@ extern struct menu *root_menu, *start_menu, *hide_menu, *menu_list;
/* These are global parameters regardless of which menu we're displaying */
extern int shiftkey;
extern int hiddenmenu;
+extern int clearmenu;
extern long long totaltimeout;
void parse_configs(char **argv);
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index 9516f72..0c39264 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1130,6 +1130,9 @@ int main(int argc, char *argv[])
local_cursor_enable(true);
cmdline = run_menu();
+ if (clearmenu)
+ clear_screen();
+
local_cursor_enable(false);
printf("\033[?25h\033[%d;1H\033[0m", END_ROW);
diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c
index a248721..d4c8848 100644
--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@ struct menu *root_menu, *start_menu, *hide_menu, *menu_list;
/* These are global parameters regardless of which menu we're displaying */
int shiftkey = 0; /* Only display menu if shift key pressed */
int hiddenmenu = 0;
+int clearmenu = 0;
long long totaltimeout = 0;
/* Keep track of global default */
@@ -690,6 +691,8 @@ static void parse_config_file(FILE * f)
m->menu_background = refdup_word(&p);
} else if ((ep = looking_at(p, "hidden"))) {
hiddenmenu = 1;
+ } else if ((ep = looking_at(p, "clear"))) {
+ clearmenu = 1;
} else if ((ep = is_message_name(p, &msgnr))) {
refstr_put(m->messages[msgnr]);
m->messages[msgnr] = refstrdup(skipspace(ep));
diff --git a/doc/menu.txt b/doc/menu.txt
index e160124..c912c1d 100644
--- a/doc/menu.txt
+++ b/doc/menu.txt
@@ -48,6 +48,14 @@ MENU HIDDEN
All that is displayed is a timeout message.
+MENU CLEAR
+
+ Clear the screen when exiting the menu, instead of leaving the
+ menu displayed. For vesamenu, this means the graphical
+ background is still displayed without the menu itself for as
+ long as the screen remains in graphics mode.
+
+
MENU SHIFTKEY
Exit the menu system immediately unless either the Shift or Alt
More information about the Syslinux-commits
mailing list