Commit 5a49b79c authored by Dmitry Antipov's avatar Dmitry Antipov

* frame.h (struct frame): Put menu_bar_window under #ifdef

because this member is not needed when X toolkit is in use.
(fset_menu_bar_window):
* dispnew.c (clear_current_matrices, clear_desired_matrices)
(free_glyphs, update_frame):
* xdisp.c (expose_frame): Likewise.
(display_menu_bar): Likewise.  Remove redundant eassert.
* window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
toolkit is in use.
parent 7b1123d8
2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
* frame.h (struct frame): Put menu_bar_window under #ifdef
because this member is not needed when X toolkit is in use.
(fset_menu_bar_window):
* dispnew.c (clear_current_matrices, clear_desired_matrices)
(free_glyphs, update_frame):
* xdisp.c (expose_frame): Likewise.
(display_menu_bar): Likewise. Remove redundant eassert.
* window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
toolkit is in use.
2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
Use functions and constants to manipulate Lisp_Save_Value objects.
......
......@@ -794,11 +794,13 @@ clear_current_matrices (register struct frame *f)
if (f->current_matrix)
clear_glyph_matrix (f->current_matrix);
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Clear the matrix of the menu bar window, if such a window exists.
The menu bar window is currently used to display menus on X when
no toolkit support is compiled in. */
if (WINDOWP (f->menu_bar_window))
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
#endif
/* Clear the matrix of the tool-bar window, if any. */
if (WINDOWP (f->tool_bar_window))
......@@ -818,8 +820,10 @@ clear_desired_matrices (register struct frame *f)
if (f->desired_matrix)
clear_glyph_matrix (f->desired_matrix);
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
if (WINDOWP (f->menu_bar_window))
clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
#endif
if (WINDOWP (f->tool_bar_window))
clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
......@@ -2184,6 +2188,7 @@ free_glyphs (struct frame *f)
if (!NILP (f->root_window))
free_window_matrices (XWINDOW (f->root_window));
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Free the dummy window for menu bars without X toolkit and its
glyph matrices. */
if (!NILP (f->menu_bar_window))
......@@ -2194,6 +2199,7 @@ free_glyphs (struct frame *f)
w->desired_matrix = w->current_matrix = NULL;
fset_menu_bar_window (f, Qnil);
}
#endif
/* Free the tool bar window and its glyph matrices. */
if (!NILP (f->tool_bar_window))
......@@ -3092,10 +3098,12 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
when pending input is detected. */
update_begin (f);
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* Update the menu bar on X frames that don't have toolkit
support. */
if (WINDOWP (f->menu_bar_window))
update_window (XWINDOW (f->menu_bar_window), 1);
#endif
/* Update the tool-bar window, if present. */
if (WINDOWP (f->tool_bar_window))
......
......@@ -170,9 +170,11 @@ struct frame
most recently buried buffer is first. For last-buffer. */
Lisp_Object buried_buffer_list;
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
/* A dummy window used to display menu bars under X when no X
toolkit support is available. */
Lisp_Object menu_bar_window;
#endif
/* A window used to display the tool-bar of a frame. */
Lisp_Object tool_bar_window;
......@@ -515,11 +517,13 @@ fset_menu_bar_vector (struct frame *f, Lisp_Object val)
{
f->menu_bar_vector = val;
}
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
FRAME_INLINE void
fset_menu_bar_window (struct frame *f, Lisp_Object val)
{
f->menu_bar_window = val;
}
#endif
FRAME_INLINE void
fset_name (struct frame *f, Lisp_Object val)
{
......
......@@ -512,9 +512,14 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* 1 if W is a menu bar window. */
#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
#define WINDOW_MENU_BAR_P(W) \
(WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \
&& (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
#else
/* No menu bar windows if X toolkit is in use. */
#define WINDOW_MENU_BAR_P(W) (0)
#endif
/* 1 if W is a tool bar window. */
......
......@@ -19988,18 +19988,17 @@ display_menu_bar (struct window *w)
return;
#endif /* HAVE_NS */
#ifdef USE_X_TOOLKIT
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
eassert (!FRAME_WINDOW_P (f));
init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID);
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
#else /* not USE_X_TOOLKIT */
#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */
if (FRAME_WINDOW_P (f))
{
/* Menu bar lines are displayed in the desired matrix of the
dummy window menu_bar_window. */
struct window *menu_w;
eassert (WINDOWP (f->menu_bar_window));
menu_w = XWINDOW (f->menu_bar_window);
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
......@@ -20007,6 +20006,7 @@ display_menu_bar (struct window *w)
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
}
else
#endif /* not USE_X_TOOLKIT and not USE_GTK */
{
/* This is a TTY frame, i.e. character hpos/vpos are used as
pixel x/y. */
......@@ -20015,7 +20015,6 @@ display_menu_bar (struct window *w)
it.first_visible_x = 0;
it.last_visible_x = FRAME_COLS (f);
}
#endif /* not USE_X_TOOLKIT */
/* FIXME: This should be controlled by a user option. See the
comments in redisplay_tool_bar and display_mode_line about
......@@ -28480,11 +28479,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
#ifdef HAVE_X_WINDOWS
#ifndef MSDOS
#ifndef USE_X_TOOLKIT
#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
if (WINDOWP (f->menu_bar_window))
mouse_face_overwritten_p
|= expose_window (XWINDOW (f->menu_bar_window), &r);
#endif /* not USE_X_TOOLKIT */
#endif /* not USE_X_TOOLKIT and not USE_GTK */
#endif
#endif
......
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