From baef389ce76ba2c8b2757d77a80c762f78b75bd4 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 21 Apr 2009 20:20:52 +0400 Subject: [PATCH] menu.c (menubar_new): init the subsel field clearly. (menu_callback): show menu after screen resize. --- src/menu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/menu.c b/src/menu.c index 439980608..7fe1e1d9c 100644 --- a/src/menu.c +++ b/src/menu.c @@ -388,6 +388,9 @@ menubar_callback (Widget *w, widget_msg_t msg, int parm) case WIDGET_DRAW: if (menubar_visible) menubar_draw (menubar); + else + /* try show menu after screen resize */ + send_message (w, WIDGET_FOCUS, 0); return MSG_HANDLED; default: @@ -542,7 +545,7 @@ destroy_menu (Menu *menu) WMenu * menubar_new (int y, int x, int cols, Menu *menu[], int items) { - WMenu *menubar = g_new0 (WMenu, 1); /* FIXME: subsel used w/o being set */ + WMenu *menubar = g_new0 (WMenu, 1); init_widget (&menubar->widget, y, x, 1, cols, menubar_callback, menubar_event); @@ -551,6 +554,7 @@ menubar_new (int y, int x, int cols, Menu *menu[], int items) menubar->dropped = 0; menubar->items = items; menubar->selected = 0; + menubar->subsel = 0; widget_want_cursor (menubar->widget, 0); menubar_arrange (menubar);