Modified the hintbar draw update.

Since midnight_dlg can be invisible during screen resize,
don't update the hintbar in SIGWING signal handling function.
Now the hintbar is updated during DLG_DRAW message handling
in mignight_dlg callback.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2009-08-11 13:55:28 +04:00
parent 5feea4aead
commit e7ac83b48a
2 changed files with 8 additions and 7 deletions

View File

@ -517,6 +517,7 @@ layout_change (void)
done_menu ();
init_menu ();
menubar_arrange (the_menubar);
load_hint (1);
}
void layout_cmd (void)
@ -666,13 +667,11 @@ setup_panels (void)
LINES - output_lines - keybar_visible - 1,
LINES - keybar_visible - 1);
}
if (message_visible) {
if (message_visible)
widget_set_size (&the_hint->widget, height + start_y, 0, 1, COLS);
set_hintbar (""); /* clean up the line */
} else
else
widget_set_size (&the_hint->widget, 0, 0, 0, 0);
load_hint (1);
update_xterm_title_path ();
}

View File

@ -1516,6 +1516,7 @@ midnight_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
return MSG_NOT_HANDLED;
case DLG_DRAW:
load_hint (1);
/* We handle the special case of the output lines */
if (console_flag && output_lines)
show_console_contents (output_start_y,
@ -1580,11 +1581,13 @@ load_hint (int force)
return;
if (!message_visible) {
label_set_text (the_hint, 0);
label_set_text (the_hint, NULL);
return;
}
if ((hint = get_random_hint (force))) {
hint = get_random_hint (force);
if (hint != NULL) {
if (*hint)
set_hintbar (hint);
g_free (hint);
@ -1604,7 +1607,6 @@ setup_panels_and_run_mc (void)
add_widget (midnight_dlg, get_panel_widget (0));
add_widget (midnight_dlg, get_panel_widget (1));
add_widget (midnight_dlg, the_hint);
load_hint (1);
add_widget (midnight_dlg, cmdline);
add_widget (midnight_dlg, the_prompt);
add_widget (midnight_dlg, the_bar);