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

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