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-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.
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))
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);
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))
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))
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))
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;
{
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)
{
/* 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. */
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);
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. */
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
#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