1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Properly deselect the main menu instead of crashing

In send_kbd_event, use deselect_mainmenu to get rid of the main menu
instead of delete_window. This fixes bug 747.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-06-19 11:07:03 +00:00 committed by Miciah Dashiel Butler Masters
parent 62a216a6fa
commit 588fa3ece8
3 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,7 @@ static void display_mainmenu(struct terminal *term, struct menu *menu);
static void set_menu_selection(struct menu *menu, int pos);
static void
void
deselect_mainmenu(struct terminal *term, struct menu *menu)
{
menu->selected = -1;

View File

@ -175,5 +175,6 @@ add_to_menu(struct menu_item **mi, unsigned char *text, unsigned char *rtext,
void do_menu(struct terminal *, struct menu_item *, void *, int);
void do_menu_selected(struct terminal *, struct menu_item *, void *, int, int);
void do_mainmenu(struct terminal *, struct menu_item *, void *, int);
void deselect_mainmenu(struct terminal *term, struct menu *menu);
#endif

View File

@ -1171,7 +1171,8 @@ quit:
win = ses->tab->term->windows.next;
win->handler(win, ev);
if (ses->tab->term->windows.next == win) {
delete_window(win);
deselect_mainmenu(win->term, win->data);
print_screen_status(ses);
get_kbd_modifier(ev) |= KBD_MOD_ALT;
return NULL;