Commit 7ce2c095 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(display_menu_bar): New function.

(redisplay_window): Call display_menu_bar.
parent 5ec75a55
......@@ -128,6 +128,7 @@ static int display_mode_element ();
static char *fmodetrunc ();
static char *decode_mode_spec ();
static int display_string ();
static void display_menu_bar ();
/* Prompt to display in front of the minibuffer contents */
char *minibuf_prompt;
......@@ -979,6 +980,12 @@ redisplay_window (window, just_this_one)
&& height != XFASTINT (w->height))
display_mode_line (w);
/* When we reach a frame's selected window, redo the frame's menu bar. */
if (!NILP (w->update_mode_line)
&& FRAME_MENU_BAR_LINES (f) > 0
&& EQ (FRAME_SELECTED_WINDOW (f), window))
display_menu_bar (w);
finish_scroll_bars:
if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
{
......@@ -1824,6 +1831,44 @@ display_text_line (w, start, vpos, hpos, taboffset)
return &val_display_text_line;
}
/* Redisplay the menu bar in the frame for window W. */
static void
display_menu_bar (w)
struct window *w;
{
Lisp_Object items, tail;
register int vpos = 0;
register FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
int maxendcol = FRAME_WIDTH (f);
int hpos = 0;
if (FRAME_MENU_BAR_LINES (f) <= 0)
return;
get_display_line (f, vpos, 0);
items = menu_bar_items ();
FRAME_MENU_BAR_ITEMS (f) = items;
for (tail = items; CONSP (tail); tail = XCONS (tail)->cdr)
{
Lisp_Object string;
string = XCONS (XCONS (XCONS (tail)->car)->cdr)->car;
/* Record in each item its hpos. */
XFASTINT (XCONS (XCONS (XCONS (tail)->car)->cdr)->cdr) = hpos;
if (hpos < maxendcol)
hpos = display_string (XWINDOW (FRAME_ROOT_WINDOW (f)), vpos,
XSTRING (string)->data,
hpos, 0, hpos, maxendcol) + 3;
}
FRAME_DESIRED_GLYPHS (f)->bufp[vpos] = 0;
FRAME_DESIRED_GLYPHS (f)->highlight[vpos] = mode_line_inverse_video;
}
/* Display the mode line for window w */
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment