aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2013-03-22 16:41:34 +0400
committerDmitry Antipov2013-03-22 16:41:34 +0400
commit5a49b79cf8ba88f0044f2a358bd83a1d2a14d412 (patch)
treedd9a4874c043d791d31368eed0ad09e80763d54d
parent7b1123d824e51d40496c242e7a7f173de8936100 (diff)
downloademacs-5a49b79cf8ba88f0044f2a358bd83a1d2a14d412.tar.gz
emacs-5a49b79cf8ba88f0044f2a358bd83a1d2a14d412.zip
* 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.
-rw-r--r--src/ChangeLog12
-rw-r--r--src/dispnew.c8
-rw-r--r--src/frame.h4
-rw-r--r--src/window.h5
-rw-r--r--src/xdisp.c11
5 files changed, 34 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f65e08eb6fd..7e6e08ac5c2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * frame.h (struct frame): Put menu_bar_window under #ifdef
4 because this member is not needed when X toolkit is in use.
5 (fset_menu_bar_window):
6 * dispnew.c (clear_current_matrices, clear_desired_matrices)
7 (free_glyphs, update_frame):
8 * xdisp.c (expose_frame): Likewise.
9 (display_menu_bar): Likewise. Remove redundant eassert.
10 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
11 toolkit is in use.
12
12013-03-21 Paul Eggert <eggert@cs.ucla.edu> 132013-03-21 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 Use functions and constants to manipulate Lisp_Save_Value objects. 15 Use functions and constants to manipulate Lisp_Save_Value objects.
diff --git a/src/dispnew.c b/src/dispnew.c
index bc65050605a..41d4844707e 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -794,11 +794,13 @@ clear_current_matrices (register struct frame *f)
794 if (f->current_matrix) 794 if (f->current_matrix)
795 clear_glyph_matrix (f->current_matrix); 795 clear_glyph_matrix (f->current_matrix);
796 796
797#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
797 /* Clear the matrix of the menu bar window, if such a window exists. 798 /* Clear the matrix of the menu bar window, if such a window exists.
798 The menu bar window is currently used to display menus on X when 799 The menu bar window is currently used to display menus on X when
799 no toolkit support is compiled in. */ 800 no toolkit support is compiled in. */
800 if (WINDOWP (f->menu_bar_window)) 801 if (WINDOWP (f->menu_bar_window))
801 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); 802 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
803#endif
802 804
803 /* Clear the matrix of the tool-bar window, if any. */ 805 /* Clear the matrix of the tool-bar window, if any. */
804 if (WINDOWP (f->tool_bar_window)) 806 if (WINDOWP (f->tool_bar_window))
@@ -818,8 +820,10 @@ clear_desired_matrices (register struct frame *f)
818 if (f->desired_matrix) 820 if (f->desired_matrix)
819 clear_glyph_matrix (f->desired_matrix); 821 clear_glyph_matrix (f->desired_matrix);
820 822
823#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
821 if (WINDOWP (f->menu_bar_window)) 824 if (WINDOWP (f->menu_bar_window))
822 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); 825 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
826#endif
823 827
824 if (WINDOWP (f->tool_bar_window)) 828 if (WINDOWP (f->tool_bar_window))
825 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); 829 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
@@ -2184,6 +2188,7 @@ free_glyphs (struct frame *f)
2184 if (!NILP (f->root_window)) 2188 if (!NILP (f->root_window))
2185 free_window_matrices (XWINDOW (f->root_window)); 2189 free_window_matrices (XWINDOW (f->root_window));
2186 2190
2191#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
2187 /* Free the dummy window for menu bars without X toolkit and its 2192 /* Free the dummy window for menu bars without X toolkit and its
2188 glyph matrices. */ 2193 glyph matrices. */
2189 if (!NILP (f->menu_bar_window)) 2194 if (!NILP (f->menu_bar_window))
@@ -2194,6 +2199,7 @@ free_glyphs (struct frame *f)
2194 w->desired_matrix = w->current_matrix = NULL; 2199 w->desired_matrix = w->current_matrix = NULL;
2195 fset_menu_bar_window (f, Qnil); 2200 fset_menu_bar_window (f, Qnil);
2196 } 2201 }
2202#endif
2197 2203
2198 /* Free the tool bar window and its glyph matrices. */ 2204 /* Free the tool bar window and its glyph matrices. */
2199 if (!NILP (f->tool_bar_window)) 2205 if (!NILP (f->tool_bar_window))
@@ -3092,10 +3098,12 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3092 when pending input is detected. */ 3098 when pending input is detected. */
3093 update_begin (f); 3099 update_begin (f);
3094 3100
3101#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
3095 /* Update the menu bar on X frames that don't have toolkit 3102 /* Update the menu bar on X frames that don't have toolkit
3096 support. */ 3103 support. */
3097 if (WINDOWP (f->menu_bar_window)) 3104 if (WINDOWP (f->menu_bar_window))
3098 update_window (XWINDOW (f->menu_bar_window), 1); 3105 update_window (XWINDOW (f->menu_bar_window), 1);
3106#endif
3099 3107
3100 /* Update the tool-bar window, if present. */ 3108 /* Update the tool-bar window, if present. */
3101 if (WINDOWP (f->tool_bar_window)) 3109 if (WINDOWP (f->tool_bar_window))
diff --git a/src/frame.h b/src/frame.h
index 7a4943327eb..32a6954024e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -170,9 +170,11 @@ struct frame
170 most recently buried buffer is first. For last-buffer. */ 170 most recently buried buffer is first. For last-buffer. */
171 Lisp_Object buried_buffer_list; 171 Lisp_Object buried_buffer_list;
172 172
173#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
173 /* A dummy window used to display menu bars under X when no X 174 /* A dummy window used to display menu bars under X when no X
174 toolkit support is available. */ 175 toolkit support is available. */
175 Lisp_Object menu_bar_window; 176 Lisp_Object menu_bar_window;
177#endif
176 178
177 /* A window used to display the tool-bar of a frame. */ 179 /* A window used to display the tool-bar of a frame. */
178 Lisp_Object tool_bar_window; 180 Lisp_Object tool_bar_window;
@@ -515,11 +517,13 @@ fset_menu_bar_vector (struct frame *f, Lisp_Object val)
515{ 517{
516 f->menu_bar_vector = val; 518 f->menu_bar_vector = val;
517} 519}
520#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
518FRAME_INLINE void 521FRAME_INLINE void
519fset_menu_bar_window (struct frame *f, Lisp_Object val) 522fset_menu_bar_window (struct frame *f, Lisp_Object val)
520{ 523{
521 f->menu_bar_window = val; 524 f->menu_bar_window = val;
522} 525}
526#endif
523FRAME_INLINE void 527FRAME_INLINE void
524fset_name (struct frame *f, Lisp_Object val) 528fset_name (struct frame *f, Lisp_Object val)
525{ 529{
diff --git a/src/window.h b/src/window.h
index 4f6374b9d3e..71c438ff7f2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -512,9 +512,14 @@ wset_next_buffers (struct window *w, Lisp_Object val)
512 512
513/* 1 if W is a menu bar window. */ 513/* 1 if W is a menu bar window. */
514 514
515#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
515#define WINDOW_MENU_BAR_P(W) \ 516#define WINDOW_MENU_BAR_P(W) \
516 (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \ 517 (WINDOWP (WINDOW_XFRAME (W)->menu_bar_window) \
517 && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window)) 518 && (W) == XWINDOW (WINDOW_XFRAME (W)->menu_bar_window))
519#else
520/* No menu bar windows if X toolkit is in use. */
521#define WINDOW_MENU_BAR_P(W) (0)
522#endif
518 523
519/* 1 if W is a tool bar window. */ 524/* 1 if W is a tool bar window. */
520 525
diff --git a/src/xdisp.c b/src/xdisp.c
index 2a565b5cffd..02a8e56b3bd 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19988,18 +19988,17 @@ display_menu_bar (struct window *w)
19988 return; 19988 return;
19989#endif /* HAVE_NS */ 19989#endif /* HAVE_NS */
19990 19990
19991#ifdef USE_X_TOOLKIT 19991#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
19992 eassert (!FRAME_WINDOW_P (f)); 19992 eassert (!FRAME_WINDOW_P (f));
19993 init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID); 19993 init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID);
19994 it.first_visible_x = 0; 19994 it.first_visible_x = 0;
19995 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); 19995 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
19996#else /* not USE_X_TOOLKIT */ 19996#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */
19997 if (FRAME_WINDOW_P (f)) 19997 if (FRAME_WINDOW_P (f))
19998 { 19998 {
19999 /* Menu bar lines are displayed in the desired matrix of the 19999 /* Menu bar lines are displayed in the desired matrix of the
20000 dummy window menu_bar_window. */ 20000 dummy window menu_bar_window. */
20001 struct window *menu_w; 20001 struct window *menu_w;
20002 eassert (WINDOWP (f->menu_bar_window));
20003 menu_w = XWINDOW (f->menu_bar_window); 20002 menu_w = XWINDOW (f->menu_bar_window);
20004 init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows, 20003 init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
20005 MENU_FACE_ID); 20004 MENU_FACE_ID);
@@ -20007,6 +20006,7 @@ display_menu_bar (struct window *w)
20007 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); 20006 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
20008 } 20007 }
20009 else 20008 else
20009#endif /* not USE_X_TOOLKIT and not USE_GTK */
20010 { 20010 {
20011 /* This is a TTY frame, i.e. character hpos/vpos are used as 20011 /* This is a TTY frame, i.e. character hpos/vpos are used as
20012 pixel x/y. */ 20012 pixel x/y. */
@@ -20015,7 +20015,6 @@ display_menu_bar (struct window *w)
20015 it.first_visible_x = 0; 20015 it.first_visible_x = 0;
20016 it.last_visible_x = FRAME_COLS (f); 20016 it.last_visible_x = FRAME_COLS (f);
20017 } 20017 }
20018#endif /* not USE_X_TOOLKIT */
20019 20018
20020 /* FIXME: This should be controlled by a user option. See the 20019 /* FIXME: This should be controlled by a user option. See the
20021 comments in redisplay_tool_bar and display_mode_line about 20020 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 28479
28481#ifdef HAVE_X_WINDOWS 28480#ifdef HAVE_X_WINDOWS
28482#ifndef MSDOS 28481#ifndef MSDOS
28483#ifndef USE_X_TOOLKIT 28482#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
28484 if (WINDOWP (f->menu_bar_window)) 28483 if (WINDOWP (f->menu_bar_window))
28485 mouse_face_overwritten_p 28484 mouse_face_overwritten_p
28486 |= expose_window (XWINDOW (f->menu_bar_window), &r); 28485 |= expose_window (XWINDOW (f->menu_bar_window), &r);
28487#endif /* not USE_X_TOOLKIT */ 28486#endif /* not USE_X_TOOLKIT and not USE_GTK */
28488#endif 28487#endif
28489#endif 28488#endif
28490 28489