aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-09-11 11:11:34 +0200
committerJoakim Verona2013-09-11 11:11:34 +0200
commitd1ae916c78cf224dd9b107b42d1258db7b096c11 (patch)
treea52d37655a89e0ca6df57e2ee3bf13daf3d20798 /src
parent9bdba396e40b4461b78d3fbf8620d6b61004bf39 (diff)
parent742516e02048d3bbfba4e6e13dd19afa097bbd3b (diff)
downloademacs-d1ae916c78cf224dd9b107b42d1258db7b096c11.tar.gz
emacs-d1ae916c78cf224dd9b107b42d1258db7b096c11.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog23
-rw-r--r--src/dispnew.c19
-rw-r--r--src/frame.h34
-rw-r--r--src/window.c6
-rw-r--r--src/window.h5
-rw-r--r--src/xdisp.c36
-rw-r--r--src/xfns.c11
-rw-r--r--src/xterm.c13
8 files changed, 102 insertions, 45 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 21cb47eeeaa..83e5dbcdaff 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,26 @@
12013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Ifdef away frame tool bar code when it is not really used.
4 * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]:
5 Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string
6 and minimize_tool_bar_window_p under the above.
7 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8 (fset_tool_bar_window): Likewise.
9 * dispnew.c (clear_current_matrices, clear_desired_matrices)
10 (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame)
11 (change_frame_size_1):
12 * window.c (window_from_coordinates, Frecenter): Adjust users.
13 * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar
14 code is not really used.
15 * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line)
16 (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info)
17 (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight)
18 [!USE_GTK && !HAVE_NS]: Define as such.
19 (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face)
20 (note_mouse_highlight, expose_frame):
21 * xfns.c (x_set_tool_bar_lines):
22 * xterm.c (handle_one_xevent): Adjust users.
23
12013-09-11 Paul Eggert <eggert@cs.ucla.edu> 242013-09-11 Paul Eggert <eggert@cs.ucla.edu>
2 25
3 Fix corruption with multiple emacsclient -t instances (Bug#15222). 26 Fix corruption with multiple emacsclient -t instances (Bug#15222).
diff --git a/src/dispnew.c b/src/dispnew.c
index c239d7ab745..cd7be59c122 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -785,9 +785,11 @@ clear_current_matrices (register struct frame *f)
785 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); 785 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
786#endif 786#endif
787 787
788#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
788 /* Clear the matrix of the tool-bar window, if any. */ 789 /* Clear the matrix of the tool-bar window, if any. */
789 if (WINDOWP (f->tool_bar_window)) 790 if (WINDOWP (f->tool_bar_window))
790 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); 791 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
792#endif
791 793
792 /* Clear current window matrices. */ 794 /* Clear current window matrices. */
793 eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); 795 eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
@@ -808,8 +810,10 @@ clear_desired_matrices (register struct frame *f)
808 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); 810 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
809#endif 811#endif
810 812
813#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
811 if (WINDOWP (f->tool_bar_window)) 814 if (WINDOWP (f->tool_bar_window))
812 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); 815 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
816#endif
813 817
814 /* Do it for window matrices. */ 818 /* Do it for window matrices. */
815 eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); 819 eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
@@ -2043,10 +2047,9 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2043 /* Allocate/reallocate window matrices. */ 2047 /* Allocate/reallocate window matrices. */
2044 allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f))); 2048 allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f)));
2045 2049
2046#ifdef HAVE_X_WINDOWS 2050#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
2047 /* Allocate/ reallocate matrices of the dummy window used to display 2051 /* Allocate/ reallocate matrices of the dummy window used to display
2048 the menu bar under X when no X toolkit support is available. */ 2052 the menu bar under X when no X toolkit support is available. */
2049#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
2050 { 2053 {
2051 /* Allocate a dummy window if not already done. */ 2054 /* Allocate a dummy window if not already done. */
2052 struct window *w; 2055 struct window *w;
@@ -2070,10 +2073,9 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2070 w->total_cols = FRAME_TOTAL_COLS (f); 2073 w->total_cols = FRAME_TOTAL_COLS (f);
2071 allocate_matrices_for_window_redisplay (w); 2074 allocate_matrices_for_window_redisplay (w);
2072 } 2075 }
2073#endif /* not USE_X_TOOLKIT && not USE_GTK */ 2076#endif
2074#endif /* HAVE_X_WINDOWS */
2075 2077
2076#ifndef USE_GTK 2078#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
2077 { 2079 {
2078 /* Allocate/ reallocate matrices of the tool bar window. If we 2080 /* Allocate/ reallocate matrices of the tool bar window. If we
2079 don't have a tool bar window yet, make one. */ 2081 don't have a tool bar window yet, make one. */
@@ -2147,6 +2149,7 @@ free_glyphs (struct frame *f)
2147 } 2149 }
2148#endif 2150#endif
2149 2151
2152#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
2150 /* Free the tool bar window and its glyph matrices. */ 2153 /* Free the tool bar window and its glyph matrices. */
2151 if (!NILP (f->tool_bar_window)) 2154 if (!NILP (f->tool_bar_window))
2152 { 2155 {
@@ -2156,6 +2159,7 @@ free_glyphs (struct frame *f)
2156 w->desired_matrix = w->current_matrix = NULL; 2159 w->desired_matrix = w->current_matrix = NULL;
2157 fset_tool_bar_window (f, Qnil); 2160 fset_tool_bar_window (f, Qnil);
2158 } 2161 }
2162#endif
2159 2163
2160 /* Release frame glyph matrices. Reset fields to zero in 2164 /* Release frame glyph matrices. Reset fields to zero in
2161 case we are called a second time. */ 2165 case we are called a second time. */
@@ -3038,6 +3042,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3038 update_window (XWINDOW (f->menu_bar_window), 1); 3042 update_window (XWINDOW (f->menu_bar_window), 1);
3039#endif 3043#endif
3040 3044
3045#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
3041 /* Update the tool-bar window, if present. */ 3046 /* Update the tool-bar window, if present. */
3042 if (WINDOWP (f->tool_bar_window)) 3047 if (WINDOWP (f->tool_bar_window))
3043 { 3048 {
@@ -3058,7 +3063,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3058 fset_desired_tool_bar_string (f, tem); 3063 fset_desired_tool_bar_string (f, tem);
3059 } 3064 }
3060 } 3065 }
3061 3066#endif
3062 3067
3063 /* Update windows. */ 3068 /* Update windows. */
3064 paused_p = update_window_tree (root_window, force_p); 3069 paused_p = update_window_tree (root_window, force_p);
@@ -5499,8 +5504,10 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
5499 if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) 5504 if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
5500 FrameCols (FRAME_TTY (f)) = newwidth; 5505 FrameCols (FRAME_TTY (f)) = newwidth;
5501 5506
5507#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
5502 if (WINDOWP (f->tool_bar_window)) 5508 if (WINDOWP (f->tool_bar_window))
5503 XWINDOW (f->tool_bar_window)->total_cols = newwidth; 5509 XWINDOW (f->tool_bar_window)->total_cols = newwidth;
5510#endif
5504 } 5511 }
5505 5512
5506 FRAME_LINES (f) = newheight; 5513 FRAME_LINES (f) = newheight;
diff --git a/src/frame.h b/src/frame.h
index 87e218ee938..3aea0cfa27c 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -145,9 +145,15 @@ struct frame
145 Lisp_Object menu_bar_window; 145 Lisp_Object menu_bar_window;
146#endif 146#endif
147 147
148#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
148 /* A window used to display the tool-bar of a frame. */ 149 /* A window used to display the tool-bar of a frame. */
149 Lisp_Object tool_bar_window; 150 Lisp_Object tool_bar_window;
150 151
152 /* Desired and current contents displayed in that window. */
153 Lisp_Object desired_tool_bar_string;
154 Lisp_Object current_tool_bar_string;
155#endif
156
151 /* Desired and current tool-bar items. */ 157 /* Desired and current tool-bar items. */
152 Lisp_Object tool_bar_items; 158 Lisp_Object tool_bar_items;
153 159
@@ -155,10 +161,6 @@ struct frame
155 tool bar only supports top. */ 161 tool bar only supports top. */
156 Lisp_Object tool_bar_position; 162 Lisp_Object tool_bar_position;
157 163
158 /* Desired and current contents displayed in tool_bar_window. */
159 Lisp_Object desired_tool_bar_string;
160 Lisp_Object current_tool_bar_string;
161
162 /* Beyond here, there should be no more Lisp_Object components. */ 164 /* Beyond here, there should be no more Lisp_Object components. */
163 165
164 /* Cache of realized faces. */ 166 /* Cache of realized faces. */
@@ -197,9 +199,11 @@ struct frame
197 /* Set to non-zero when current redisplay has updated frame. */ 199 /* Set to non-zero when current redisplay has updated frame. */
198 unsigned updated_p : 1; 200 unsigned updated_p : 1;
199 201
202#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
200 /* Set to non-zero to minimize tool-bar height even when 203 /* Set to non-zero to minimize tool-bar height even when
201 auto-resize-tool-bar is set to grow-only. */ 204 auto-resize-tool-bar is set to grow-only. */
202 unsigned minimize_tool_bar_window_p : 1; 205 unsigned minimize_tool_bar_window_p : 1;
206#endif
203 207
204#if defined (USE_GTK) || defined (HAVE_NS) 208#if defined (USE_GTK) || defined (HAVE_NS)
205 /* Nonzero means using a tool bar that comes from the toolkit. */ 209 /* Nonzero means using a tool bar that comes from the toolkit. */
@@ -455,16 +459,6 @@ fset_condemned_scroll_bars (struct frame *f, Lisp_Object val)
455 f->condemned_scroll_bars = val; 459 f->condemned_scroll_bars = val;
456} 460}
457FRAME_INLINE void 461FRAME_INLINE void
458fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
459{
460 f->current_tool_bar_string = val;
461}
462FRAME_INLINE void
463fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
464{
465 f->desired_tool_bar_string = val;
466}
467FRAME_INLINE void
468fset_face_alist (struct frame *f, Lisp_Object val) 462fset_face_alist (struct frame *f, Lisp_Object val)
469{ 463{
470 f->face_alist = val; 464 f->face_alist = val;
@@ -536,11 +530,23 @@ fset_tool_bar_position (struct frame *f, Lisp_Object val)
536{ 530{
537 f->tool_bar_position = val; 531 f->tool_bar_position = val;
538} 532}
533#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
539FRAME_INLINE void 534FRAME_INLINE void
540fset_tool_bar_window (struct frame *f, Lisp_Object val) 535fset_tool_bar_window (struct frame *f, Lisp_Object val)
541{ 536{
542 f->tool_bar_window = val; 537 f->tool_bar_window = val;
543} 538}
539FRAME_INLINE void
540fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
541{
542 f->current_tool_bar_string = val;
543}
544FRAME_INLINE void
545fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
546{
547 f->desired_tool_bar_string = val;
548}
549#endif /* HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS */
544 550
545#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1) 551#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1)
546 552
diff --git a/src/window.c b/src/window.c
index 410015e472e..74b76341446 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1385,6 +1385,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1385 cw.window = &window, cw.x = x, cw.y = y; cw.part = part; 1385 cw.window = &window, cw.x = x, cw.y = y; cw.part = part;
1386 foreach_window (f, check_window_containing, &cw); 1386 foreach_window (f, check_window_containing, &cw);
1387 1387
1388#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
1388 /* If not found above, see if it's in the tool bar window, if a tool 1389 /* If not found above, see if it's in the tool bar window, if a tool
1389 bar exists. */ 1390 bar exists. */
1390 if (NILP (window) 1391 if (NILP (window)
@@ -1397,6 +1398,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1397 *part = ON_TEXT; 1398 *part = ON_TEXT;
1398 window = f->tool_bar_window; 1399 window = f->tool_bar_window;
1399 } 1400 }
1401#endif
1400 1402
1401 return window; 1403 return window;
1402} 1404}
@@ -5121,9 +5123,9 @@ and redisplay normally--don't erase and redraw the frame. */)
5121 /* Invalidate pixel data calculated for all compositions. */ 5123 /* Invalidate pixel data calculated for all compositions. */
5122 for (i = 0; i < n_compositions; i++) 5124 for (i = 0; i < n_compositions; i++)
5123 composition_table[i]->font = NULL; 5125 composition_table[i]->font = NULL;
5124 5126#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
5125 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; 5127 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1;
5126 5128#endif
5127 Fredraw_frame (WINDOW_FRAME (w)); 5129 Fredraw_frame (WINDOW_FRAME (w));
5128 SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); 5130 SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
5129 } 5131 }
diff --git a/src/window.h b/src/window.h
index f5ae81149b3..a419bf7e7f0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -525,10 +525,13 @@ wset_next_buffers (struct window *w, Lisp_Object val)
525#endif 525#endif
526 526
527/* 1 if W is a tool bar window. */ 527/* 1 if W is a tool bar window. */
528 528#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
529#define WINDOW_TOOL_BAR_P(W) \ 529#define WINDOW_TOOL_BAR_P(W) \
530 (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \ 530 (WINDOWP (WINDOW_XFRAME (W)->tool_bar_window) \
531 && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window)) 531 && (W) == XWINDOW (WINDOW_XFRAME (W)->tool_bar_window))
532#else
533#define WINDOW_TOOL_BAR_P(W) (0)
534#endif
532 535
533/* Return the frame y-position at which window W starts. 536/* Return the frame y-position at which window W starts.
534 This includes a header line, if any. */ 537 This includes a header line, if any. */
diff --git a/src/xdisp.c b/src/xdisp.c
index b9a16ffcc43..1a7cdb88db5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -920,11 +920,8 @@ static int in_ellipses_for_invisible_text_p (struct display_pos *,
920#ifdef HAVE_WINDOW_SYSTEM 920#ifdef HAVE_WINDOW_SYSTEM
921 921
922static void x_consider_frame_title (Lisp_Object); 922static void x_consider_frame_title (Lisp_Object);
923static int tool_bar_lines_needed (struct frame *, int *);
924static void update_tool_bar (struct frame *, int); 923static void update_tool_bar (struct frame *, int);
925static void build_desired_tool_bar_string (struct frame *f);
926static int redisplay_tool_bar (struct frame *); 924static int redisplay_tool_bar (struct frame *);
927static void display_tool_bar_line (struct it *, int);
928static void notice_overwritten_cursor (struct window *, 925static void notice_overwritten_cursor (struct window *,
929 enum glyph_row_area, 926 enum glyph_row_area,
930 int, int, int, int); 927 int, int, int, int);
@@ -11622,6 +11619,7 @@ update_tool_bar (struct frame *f, int save_match_data)
11622 } 11619 }
11623} 11620}
11624 11621
11622#if ! defined (USE_GTK) && ! defined (HAVE_NS)
11625 11623
11626/* Set F->desired_tool_bar_string to a Lisp string representing frame 11624/* Set F->desired_tool_bar_string to a Lisp string representing frame
11627 F's desired tool-bar contents. F->tool_bar_items must have 11625 F's desired tool-bar contents. F->tool_bar_items must have
@@ -11959,6 +11957,7 @@ tool_bar_lines_needed (struct frame *f, int *n_rows)
11959 return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); 11957 return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
11960} 11958}
11961 11959
11960#endif /* !USE_GTK && !HAVE_NS */
11962 11961
11963DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 11962DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
11964 0, 1, 0, 11963 0, 1, 0,
@@ -11966,9 +11965,10 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
11966If FRAME is nil or omitted, use the selected frame. */) 11965If FRAME is nil or omitted, use the selected frame. */)
11967 (Lisp_Object frame) 11966 (Lisp_Object frame)
11968{ 11967{
11968 int nlines = 0;
11969#if ! defined (USE_GTK) && ! defined (HAVE_NS)
11969 struct frame *f = decode_any_frame (frame); 11970 struct frame *f = decode_any_frame (frame);
11970 struct window *w; 11971 struct window *w;
11971 int nlines = 0;
11972 11972
11973 if (WINDOWP (f->tool_bar_window) 11973 if (WINDOWP (f->tool_bar_window)
11974 && (w = XWINDOW (f->tool_bar_window), 11974 && (w = XWINDOW (f->tool_bar_window),
@@ -11981,7 +11981,7 @@ If FRAME is nil or omitted, use the selected frame. */)
11981 nlines = tool_bar_lines_needed (f, NULL); 11981 nlines = tool_bar_lines_needed (f, NULL);
11982 } 11982 }
11983 } 11983 }
11984 11984#endif
11985 return make_number (nlines); 11985 return make_number (nlines);
11986} 11986}
11987 11987
@@ -11992,15 +11992,17 @@ If FRAME is nil or omitted, use the selected frame. */)
11992static int 11992static int
11993redisplay_tool_bar (struct frame *f) 11993redisplay_tool_bar (struct frame *f)
11994{ 11994{
11995 struct window *w;
11996 struct it it;
11997 struct glyph_row *row;
11998
11999#if defined (USE_GTK) || defined (HAVE_NS) 11995#if defined (USE_GTK) || defined (HAVE_NS)
11996
12000 if (FRAME_EXTERNAL_TOOL_BAR (f)) 11997 if (FRAME_EXTERNAL_TOOL_BAR (f))
12001 update_frame_tool_bar (f); 11998 update_frame_tool_bar (f);
12002 return 0; 11999 return 0;
12003#endif 12000
12001#else /* !USE_GTK && !HAVE_NS */
12002
12003 struct window *w;
12004 struct it it;
12005 struct glyph_row *row;
12004 12006
12005 /* If frame hasn't a tool-bar window or if it is zero-height, don't 12007 /* If frame hasn't a tool-bar window or if it is zero-height, don't
12006 do anything. This means you must start with tool-bar-lines 12008 do anything. This means you must start with tool-bar-lines
@@ -12156,8 +12158,11 @@ redisplay_tool_bar (struct frame *f)
12156 12158
12157 f->minimize_tool_bar_window_p = 0; 12159 f->minimize_tool_bar_window_p = 0;
12158 return 0; 12160 return 0;
12161
12162#endif /* USE_GTK || HAVE_NS */
12159} 12163}
12160 12164
12165#if ! defined (USE_GTK) && ! defined (HAVE_NS)
12161 12166
12162/* Get information about the tool-bar item which is displayed in GLYPH 12167/* Get information about the tool-bar item which is displayed in GLYPH
12163 on frame F. Return in *PROP_IDX the index where tool-bar item 12168 on frame F. Return in *PROP_IDX the index where tool-bar item
@@ -12401,6 +12406,8 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12401 help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); 12406 help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION);
12402} 12407}
12403 12408
12409#endif /* !USE_GTK && !HAVE_NS */
12410
12404#endif /* HAVE_WINDOW_SYSTEM */ 12411#endif /* HAVE_WINDOW_SYSTEM */
12405 12412
12406 12413
@@ -26945,10 +26952,13 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
26945 /* Change the mouse cursor. */ 26952 /* Change the mouse cursor. */
26946 if (FRAME_WINDOW_P (f)) 26953 if (FRAME_WINDOW_P (f))
26947 { 26954 {
26955#if ! defined (USE_GTK) && ! defined (HAVE_NS)
26948 if (draw == DRAW_NORMAL_TEXT 26956 if (draw == DRAW_NORMAL_TEXT
26949 && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) 26957 && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
26950 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); 26958 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
26951 else if (draw == DRAW_MOUSE_FACE) 26959 else
26960#endif
26961 if (draw == DRAW_MOUSE_FACE)
26952 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); 26962 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
26953 else 26963 else
26954 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); 26964 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
@@ -28286,7 +28296,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28286 w = XWINDOW (window); 28296 w = XWINDOW (window);
28287 frame_to_window_pixel_xy (w, &x, &y); 28297 frame_to_window_pixel_xy (w, &x, &y);
28288 28298
28289#ifdef HAVE_WINDOW_SYSTEM 28299#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
28290 /* Handle tool-bar window differently since it doesn't display a 28300 /* Handle tool-bar window differently since it doesn't display a
28291 buffer. */ 28301 buffer. */
28292 if (EQ (window, f->tool_bar_window)) 28302 if (EQ (window, f->tool_bar_window))
@@ -29199,9 +29209,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
29199 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); 29209 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height));
29200 mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r); 29210 mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r);
29201 29211
29212#if ! defined (USE_GTK) && ! defined (HAVE_NS)
29202 if (WINDOWP (f->tool_bar_window)) 29213 if (WINDOWP (f->tool_bar_window))
29203 mouse_face_overwritten_p 29214 mouse_face_overwritten_p
29204 |= expose_window (XWINDOW (f->tool_bar_window), &r); 29215 |= expose_window (XWINDOW (f->tool_bar_window), &r);
29216#endif
29205 29217
29206#ifdef HAVE_X_WINDOWS 29218#ifdef HAVE_X_WINDOWS
29207#ifndef MSDOS 29219#ifndef MSDOS
diff --git a/src/xfns.c b/src/xfns.c
index 4e8442dd3a3..1626e2177cb 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1215,8 +1215,11 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1215void 1215void
1216x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) 1216x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1217{ 1217{
1218 int delta, nlines, root_height; 1218 int nlines;
1219#if ! defined (USE_GTK)
1220 int delta, root_height;
1219 Lisp_Object root_window; 1221 Lisp_Object root_window;
1222#endif
1220 1223
1221 /* Treat tool bars like menu bars. */ 1224 /* Treat tool bars like menu bars. */
1222 if (FRAME_MINIBUF_ONLY_P (f)) 1225 if (FRAME_MINIBUF_ONLY_P (f))
@@ -1229,6 +1232,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1229 nlines = 0; 1232 nlines = 0;
1230 1233
1231#ifdef USE_GTK 1234#ifdef USE_GTK
1235
1232 FRAME_TOOL_BAR_LINES (f) = 0; 1236 FRAME_TOOL_BAR_LINES (f) = 0;
1233 if (nlines) 1237 if (nlines)
1234 { 1238 {
@@ -1245,8 +1249,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1245 FRAME_EXTERNAL_TOOL_BAR (f) = 0; 1249 FRAME_EXTERNAL_TOOL_BAR (f) = 0;
1246 } 1250 }
1247 1251
1248 return; 1252#else /* !USE_GTK */
1249#endif
1250 1253
1251 /* Make sure we redisplay all windows in this frame. */ 1254 /* Make sure we redisplay all windows in this frame. */
1252 ++windows_or_buffers_changed; 1255 ++windows_or_buffers_changed;
@@ -1301,7 +1304,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1301 } 1304 }
1302 1305
1303 run_window_configuration_change_hook (f); 1306 run_window_configuration_change_hook (f);
1304 1307#endif /* USE_GTK */
1305} 1308}
1306 1309
1307 1310
diff --git a/src/xterm.c b/src/xterm.c
index 3e05ba6fed2..e317b66d0fe 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6234,6 +6234,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6234 6234
6235 f = x_any_window_to_frame (dpyinfo, event.xkey.window); 6235 f = x_any_window_to_frame (dpyinfo, event.xkey.window);
6236 6236
6237#if ! defined (USE_GTK)
6237 /* If mouse-highlight is an integer, input clears out 6238 /* If mouse-highlight is an integer, input clears out
6238 mouse highlighting. */ 6239 mouse highlighting. */
6239 if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) 6240 if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
@@ -6243,6 +6244,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6243 clear_mouse_face (hlinfo); 6244 clear_mouse_face (hlinfo);
6244 hlinfo->mouse_face_hidden = 1; 6245 hlinfo->mouse_face_hidden = 1;
6245 } 6246 }
6247#endif
6246 6248
6247#if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS 6249#if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS
6248 if (f == 0) 6250 if (f == 0)
@@ -6782,6 +6784,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6782#endif 6784#endif
6783 if (f) 6785 if (f)
6784 { 6786 {
6787#if ! defined (USE_GTK)
6785 /* Is this in the tool-bar? */ 6788 /* Is this in the tool-bar? */
6786 if (WINDOWP (f->tool_bar_window) 6789 if (WINDOWP (f->tool_bar_window)
6787 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) 6790 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)))
@@ -6794,13 +6797,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6794 tool_bar_p = EQ (window, f->tool_bar_window); 6797 tool_bar_p = EQ (window, f->tool_bar_window);
6795 6798
6796 if (tool_bar_p && event.xbutton.button < 4) 6799 if (tool_bar_p && event.xbutton.button < 4)
6797 { 6800 handle_tool_bar_click
6798 handle_tool_bar_click (f, x, y, 6801 (f, x, y, event.xbutton.type == ButtonPress,
6799 event.xbutton.type == ButtonPress, 6802 x_x_to_emacs_modifiers (dpyinfo, event.xbutton.state));
6800 x_x_to_emacs_modifiers (dpyinfo,
6801 event.xbutton.state));
6802 }
6803 } 6803 }
6804#endif /* !USE_GTK */
6804 6805
6805 if (!tool_bar_p) 6806 if (!tool_bar_p)
6806#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 6807#if defined (USE_X_TOOLKIT) || defined (USE_GTK)