aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2013-09-12 23:48:18 +0900
committerKenichi Handa2013-09-12 23:48:18 +0900
commit56d968a488c68563c5eae8264b7d3adfee9dc684 (patch)
tree712adf1c2f7e12ac9d169958ea63760ad42fc6ce /src
parentb5623270b6047528786d4550cebe0b228ecadb6b (diff)
parent4dfa4b9bd944fa385b248b5b0b56e95979119420 (diff)
downloademacs-56d968a488c68563c5eae8264b7d3adfee9dc684.tar.gz
emacs-56d968a488c68563c5eae8264b7d3adfee9dc684.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog153
-rw-r--r--src/bytecode.c8
-rw-r--r--src/charset.c2
-rw-r--r--src/data.c81
-rw-r--r--src/dispextern.h5
-rw-r--r--src/dispnew.c29
-rw-r--r--src/emacs.c6
-rw-r--r--src/eval.c4
-rw-r--r--src/fileio.c3
-rw-r--r--src/frame.c2
-rw-r--r--src/frame.h52
-rw-r--r--src/insdel.c3
-rw-r--r--src/keyboard.c21
-rw-r--r--src/lisp.h10
-rw-r--r--src/minibuf.c7
-rw-r--r--src/nsfns.m9
-rw-r--r--src/nsterm.m19
-rw-r--r--src/term.c10
-rw-r--r--src/termchar.h4
-rw-r--r--src/termhooks.h8
-rw-r--r--src/w32fns.c5
-rw-r--r--src/w32proc.c2
-rw-r--r--src/w32term.c13
-rw-r--r--src/w32term.h1
-rw-r--r--src/w32xfns.c6
-rw-r--r--src/window.c6
-rw-r--r--src/window.h5
-rw-r--r--src/xdisp.c54
-rw-r--r--src/xfns.c26
-rw-r--r--src/xterm.c112
-rw-r--r--src/xterm.h8
31 files changed, 398 insertions, 276 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f4c3f731f4..b4d1c2b67df 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,156 @@
12013-09-12 Xue Fuqiao <xfq.free@gmail.com>
2
3 * charset.c (char_charset): Document an exception for char-charset.
4
52013-09-12 Dmitry Antipov <dmantipov@yandex.ru>
6
7 * xterm.h (x_display_info): New field last_user_time...
8 * xterm.c (toplevel): ...to replace static last_user_time.
9 (handle_one_xevent, x_ewmh_activate_frame): Adjust users.
10
112013-09-12 Dmitry Antipov <dmantipov@yandex.ru>
12
13 * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip
14 scroll bar values to prevent thumb from disappear and update comment.
15
162013-09-11 Glenn Morris <rgm@gnu.org>
17
18 * emacs.c (usage_message): Possessive apostrophe tweak.
19
202013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
21
22 * nsterm.m (syms_of_nsterm): Use Qns.
23 * w32fns.c (Fx_open_connection): Remove old '#if 0' code.
24 * w32term.c (w32_create_terminal, syms_of_w32term): Use Qw32.
25 * xfns.c (x_display_info_for_name, Fx_open_connection):
26 Remove old '#if 0' code.
27 (syms_of_xfns): Use Qx.
28 * termhooks.h (fullscreen_hook): Remove the leftover.
29 (struct terminal): Fix typo in comment.
30
312013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
32
33 Cleaning up a few X scroll bar bits.
34 * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member.
35 * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
36 New member last_seen_part, going to replace...
37 * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part.
38 (xt_action_hook) [USE_LUCID]: Adjust user.
39 (xm_scroll_callback, xg_scroll_callback): Do not bloat with
40 Lucid-specific scroll bar support.
41 (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part
42 to int and adjust to use last_seen_part member.
43 (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user.
44 (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
45 Initialize last_seen_part.
46
472013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
48
49 * insdel.c (insert_from_buffer_1): Don't mark buffer as modified when
50 insert-buffer-substring an empty string.
51
522013-09-11 Paul Eggert <eggert@cs.ucla.edu>
53
54 * xdisp.c (Ftool_bar_lines_needed): Declare as 'const' if ifdeffed out,
55 avoiding a GCC warning.
56
572013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
58
59 Ifdef away frame tool bar code when it is not really used.
60 * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]:
61 Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string
62 and minimize_tool_bar_window_p under the above.
63 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
64 (fset_tool_bar_window): Likewise.
65 * dispnew.c (clear_current_matrices, clear_desired_matrices)
66 (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame)
67 (change_frame_size_1):
68 * window.c (window_from_coordinates, Frecenter): Adjust users.
69 * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar
70 code is not really used.
71 * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line)
72 (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info)
73 (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight)
74 [!USE_GTK && !HAVE_NS]: Define as such.
75 (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face)
76 (note_mouse_highlight, expose_frame):
77 * xfns.c (x_set_tool_bar_lines):
78 * xterm.c (handle_one_xevent): Adjust users.
79
802013-09-11 Paul Eggert <eggert@cs.ucla.edu>
81
82 Fix corruption with multiple emacsclient -t instances (Bug#15222).
83 This bug was introduced by my 2013-08-26 patch, which incorrectly
84 assumed that the terminfo implementation doesn't use termcap buffers.
85 * term.c (init_tty) [TERMINFO]: Remove optimization, as
86 these buffers apparently are used after all.
87 * termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too.
88 (struct tty_display_info): Define members termcap_term_buffer and
89 termcap_strings_buffer even if TERMINFO.
90
912013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
92
93 Fix last change.
94 * data.c (Feqlsign, Flss, Fgtr, Fleq, Fgeq): Add convenient
95 'usage' docstring entry to pacify make-docfile.
96
972013-09-11 Barry O'Reilly <gundaetiapo@gmail.com>
98
99 Change comparison functions =, <, >, <=, >= to take many arguments.
100 * data.c: Change comparison functions' interface and implementation.
101 * lisp.h: Make arithcompare available for efficient two arg
102 comparisons.
103 * bytecode.c: Use arithcompare.
104 * fileio.c: Use new interface.
105
1062013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
107
108 * keyboard.c (read_char): Don't break immediate_echo (bug#15332).
109
1102013-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
111
112 * eval.c (Feval): Document the new use of `lexical'.
113
1142013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
115
116 Review and drop old frame resize hack.
117 * frame.h (struct frame): Remove force_flush_display_p.
118 * dispnew.c (update_frame): Adjust user and don't call
119 flush_frame here. The comment has said that there was an issues
120 with redisplaying fringes, but I don't see any differences with
121 and without this hack. Hopefully we can continue without it.
122 * xdisp.c (clear_garbaged_frames): Adjust user and do not clear
123 current frame matrices twice if resized_p is set.
124
1252013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
126
127 Do not populate pure Xism x_sync to other ports.
128 * frame.h (x_sync): Move under HAVE_X_WINDOWS.
129 * frame.c (other_visible_frames) [HAVE_X_WINDOWS]: Use as such.
130 * nsfns.m, w32xfns.c (x_sync): Remove no-op.
131 * w32term.h (x_sync): Remove prototype.
132
1332013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
134
135 Cleanup frame flushing.
136 * dispextern.h (struct redisplay_interface):
137 Drop flush_display_optional because flush_display is enough
138 for X and flushing via RIF is just a no-op for others.
139 * frame.h (flush_frame): New function.
140 * dispnew.c (update_frame):
141 * minibuf.c (read_minibuf):
142 * xdisp.c (echo_area_display, redisplay_preserve_echo_area):
143 Use it.
144 * keyboard.c (detect_input_pending_run_timers): Do not flush
145 all frames but selected one in redisplay_preserve_echo_area.
146 * nsterm.m (ns_flush): Remove no-op.
147 (ns_redisplay_interface): Adjust user.
148 * w32term.h (x_flush): Remove no-op.
149 (w32_redisplay_interface): Adjust user.
150 * xterm.c (x_flush): Simplify because we do not flush all
151 frames at once any more. Adjust comment.
152 (x_redisplay_interface): Adjust user.
153
12013-09-07 Paul Eggert <eggert@cs.ucla.edu> 1542013-09-07 Paul Eggert <eggert@cs.ucla.edu>
2 155
3 Port --without-x --enable-gcc-warnings to Fedora 19. 156 Port --without-x --enable-gcc-warnings to Fedora 19.
diff --git a/src/bytecode.c b/src/bytecode.c
index e0e7b22ea13..3ac8b452fbe 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1367,7 +1367,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1367 Lisp_Object v1; 1367 Lisp_Object v1;
1368 BEFORE_POTENTIAL_GC (); 1368 BEFORE_POTENTIAL_GC ();
1369 v1 = POP; 1369 v1 = POP;
1370 TOP = Fgtr (TOP, v1); 1370 TOP = arithcompare (TOP, v1, ARITH_GRTR);
1371 AFTER_POTENTIAL_GC (); 1371 AFTER_POTENTIAL_GC ();
1372 NEXT; 1372 NEXT;
1373 } 1373 }
@@ -1377,7 +1377,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1377 Lisp_Object v1; 1377 Lisp_Object v1;
1378 BEFORE_POTENTIAL_GC (); 1378 BEFORE_POTENTIAL_GC ();
1379 v1 = POP; 1379 v1 = POP;
1380 TOP = Flss (TOP, v1); 1380 TOP = arithcompare (TOP, v1, ARITH_LESS);
1381 AFTER_POTENTIAL_GC (); 1381 AFTER_POTENTIAL_GC ();
1382 NEXT; 1382 NEXT;
1383 } 1383 }
@@ -1387,7 +1387,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1387 Lisp_Object v1; 1387 Lisp_Object v1;
1388 BEFORE_POTENTIAL_GC (); 1388 BEFORE_POTENTIAL_GC ();
1389 v1 = POP; 1389 v1 = POP;
1390 TOP = Fleq (TOP, v1); 1390 TOP = arithcompare (TOP, v1, ARITH_LESS_OR_EQUAL);
1391 AFTER_POTENTIAL_GC (); 1391 AFTER_POTENTIAL_GC ();
1392 NEXT; 1392 NEXT;
1393 } 1393 }
@@ -1397,7 +1397,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1397 Lisp_Object v1; 1397 Lisp_Object v1;
1398 BEFORE_POTENTIAL_GC (); 1398 BEFORE_POTENTIAL_GC ();
1399 v1 = POP; 1399 v1 = POP;
1400 TOP = Fgeq (TOP, v1); 1400 TOP = arithcompare (TOP, v1, ARITH_GRTR_OR_EQUAL);
1401 AFTER_POTENTIAL_GC (); 1401 AFTER_POTENTIAL_GC ();
1402 NEXT; 1402 NEXT;
1403 } 1403 }
diff --git a/src/charset.c b/src/charset.c
index eedf65faa6c..d46cb445f85 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -2053,6 +2053,8 @@ CH in the charset. */)
2053 2053
2054DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 2, 0, 2054DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 2, 0,
2055 doc: /* Return the charset of highest priority that contains CH. 2055 doc: /* Return the charset of highest priority that contains CH.
2056ASCII characters are an exception: for them, this function always
2057returns `ascii'.
2056If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets 2058If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets
2057from which to find the charset. It may also be a coding system. In 2059from which to find the charset. It may also be a coding system. In
2058that case, find the charset from what supported by that coding system. */) 2060that case, find the charset from what supported by that coding system. */)
diff --git a/src/data.c b/src/data.c
index 9f4bd1f1c02..51b0266eca1 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2255,10 +2255,8 @@ bool-vector. IDX starts at 0. */)
2255 2255
2256/* Arithmetic functions */ 2256/* Arithmetic functions */
2257 2257
2258enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; 2258Lisp_Object
2259 2259arithcompare (Lisp_Object num1, Lisp_Object num2, enum Arith_Comparison comparison)
2260static Lisp_Object
2261arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2262{ 2260{
2263 double f1 = 0, f2 = 0; 2261 double f1 = 0, f2 = 0;
2264 bool floatp = 0; 2262 bool floatp = 0;
@@ -2275,32 +2273,32 @@ arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2275 2273
2276 switch (comparison) 2274 switch (comparison)
2277 { 2275 {
2278 case equal: 2276 case ARITH_EQUAL:
2279 if (floatp ? f1 == f2 : XINT (num1) == XINT (num2)) 2277 if (floatp ? f1 == f2 : XINT (num1) == XINT (num2))
2280 return Qt; 2278 return Qt;
2281 return Qnil; 2279 return Qnil;
2282 2280
2283 case notequal: 2281 case ARITH_NOTEQUAL:
2284 if (floatp ? f1 != f2 : XINT (num1) != XINT (num2)) 2282 if (floatp ? f1 != f2 : XINT (num1) != XINT (num2))
2285 return Qt; 2283 return Qt;
2286 return Qnil; 2284 return Qnil;
2287 2285
2288 case less: 2286 case ARITH_LESS:
2289 if (floatp ? f1 < f2 : XINT (num1) < XINT (num2)) 2287 if (floatp ? f1 < f2 : XINT (num1) < XINT (num2))
2290 return Qt; 2288 return Qt;
2291 return Qnil; 2289 return Qnil;
2292 2290
2293 case less_or_equal: 2291 case ARITH_LESS_OR_EQUAL:
2294 if (floatp ? f1 <= f2 : XINT (num1) <= XINT (num2)) 2292 if (floatp ? f1 <= f2 : XINT (num1) <= XINT (num2))
2295 return Qt; 2293 return Qt;
2296 return Qnil; 2294 return Qnil;
2297 2295
2298 case grtr: 2296 case ARITH_GRTR:
2299 if (floatp ? f1 > f2 : XINT (num1) > XINT (num2)) 2297 if (floatp ? f1 > f2 : XINT (num1) > XINT (num2))
2300 return Qt; 2298 return Qt;
2301 return Qnil; 2299 return Qnil;
2302 2300
2303 case grtr_or_equal: 2301 case ARITH_GRTR_OR_EQUAL:
2304 if (floatp ? f1 >= f2 : XINT (num1) >= XINT (num2)) 2302 if (floatp ? f1 >= f2 : XINT (num1) >= XINT (num2))
2305 return Qt; 2303 return Qt;
2306 return Qnil; 2304 return Qnil;
@@ -2310,48 +2308,65 @@ arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2310 } 2308 }
2311} 2309}
2312 2310
2313DEFUN ("=", Feqlsign, Seqlsign, 2, 2, 0, 2311static Lisp_Object
2314 doc: /* Return t if two args, both numbers or markers, are equal. */) 2312arithcompare_driver (ptrdiff_t nargs, Lisp_Object *args,
2315 (register Lisp_Object num1, Lisp_Object num2) 2313 enum Arith_Comparison comparison)
2316{ 2314{
2317 return arithcompare (num1, num2, equal); 2315 for (ptrdiff_t argnum = 1; argnum < nargs; ++argnum)
2316 {
2317 if (EQ (Qnil, arithcompare (args[argnum-1], args[argnum], comparison)))
2318 return Qnil;
2319 }
2320 return Qt;
2318} 2321}
2319 2322
2320DEFUN ("<", Flss, Slss, 2, 2, 0, 2323DEFUN ("=", Feqlsign, Seqlsign, 1, MANY, 0,
2321 doc: /* Return t if first arg is less than second arg. Both must be numbers or markers. */) 2324 doc: /* Return t if args, all numbers or markers, are equal.
2322 (register Lisp_Object num1, Lisp_Object num2) 2325usage: (= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2326 (ptrdiff_t nargs, Lisp_Object *args)
2323{ 2327{
2324 return arithcompare (num1, num2, less); 2328 return arithcompare_driver (nargs, args, ARITH_EQUAL);
2325} 2329}
2326 2330
2327DEFUN (">", Fgtr, Sgtr, 2, 2, 0, 2331DEFUN ("<", Flss, Slss, 1, MANY, 0,
2328 doc: /* Return t if first arg is greater than second arg. Both must be numbers or markers. */) 2332 doc: /* Return t if each arg is less than the next arg. All must be numbers or markers.
2329 (register Lisp_Object num1, Lisp_Object num2) 2333usage: (< NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2334 (ptrdiff_t nargs, Lisp_Object *args)
2330{ 2335{
2331 return arithcompare (num1, num2, grtr); 2336 return arithcompare_driver (nargs, args, ARITH_LESS);
2332} 2337}
2333 2338
2334DEFUN ("<=", Fleq, Sleq, 2, 2, 0, 2339DEFUN (">", Fgtr, Sgtr, 1, MANY, 0,
2335 doc: /* Return t if first arg is less than or equal to second arg. 2340 doc: /* Return t if each arg is greater than the next arg. All must be numbers or markers.
2336Both must be numbers or markers. */) 2341usage: (> NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2337 (register Lisp_Object num1, Lisp_Object num2) 2342 (ptrdiff_t nargs, Lisp_Object *args)
2338{ 2343{
2339 return arithcompare (num1, num2, less_or_equal); 2344 return arithcompare_driver (nargs, args, ARITH_GRTR);
2340} 2345}
2341 2346
2342DEFUN (">=", Fgeq, Sgeq, 2, 2, 0, 2347DEFUN ("<=", Fleq, Sleq, 1, MANY, 0,
2343 doc: /* Return t if first arg is greater than or equal to second arg. 2348 doc: /* Return t if each arg is less than or equal to the next arg.
2344Both must be numbers or markers. */) 2349All must be numbers or markers.
2345 (register Lisp_Object num1, Lisp_Object num2) 2350usage: (<= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2351 (ptrdiff_t nargs, Lisp_Object *args)
2352{
2353 return arithcompare_driver (nargs, args, ARITH_LESS_OR_EQUAL);
2354}
2355
2356DEFUN (">=", Fgeq, Sgeq, 1, MANY, 0,
2357 doc: /* Return t if each arg is greater than or equal to the next arg.
2358All must be numbers or markers.
2359usage: (= NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2360 (ptrdiff_t nargs, Lisp_Object *args)
2346{ 2361{
2347 return arithcompare (num1, num2, grtr_or_equal); 2362 return arithcompare_driver (nargs, args, ARITH_GRTR_OR_EQUAL);
2348} 2363}
2349 2364
2350DEFUN ("/=", Fneq, Sneq, 2, 2, 0, 2365DEFUN ("/=", Fneq, Sneq, 2, 2, 0,
2351 doc: /* Return t if first arg is not equal to second arg. Both must be numbers or markers. */) 2366 doc: /* Return t if first arg is not equal to second arg. Both must be numbers or markers. */)
2352 (register Lisp_Object num1, Lisp_Object num2) 2367 (register Lisp_Object num1, Lisp_Object num2)
2353{ 2368{
2354 return arithcompare (num1, num2, notequal); 2369 return arithcompare (num1, num2, ARITH_NOTEQUAL);
2355} 2370}
2356 2371
2357DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, 2372DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
diff --git a/src/dispextern.h b/src/dispextern.h
index f15da1e6564..67de6bffabf 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2796,11 +2796,6 @@ struct redisplay_interface
2796 /* Flush the display of frame F. For X, this is XFlush. */ 2796 /* Flush the display of frame F. For X, this is XFlush. */
2797 void (*flush_display) (struct frame *f); 2797 void (*flush_display) (struct frame *f);
2798 2798
2799 /* Flush the display of frame F if non-NULL. This is called
2800 during redisplay, and should be NULL on systems which flush
2801 automatically before reading input. */
2802 void (*flush_display_optional) (struct frame *f);
2803
2804 /* Clear the mouse highlight in window W, if there is any. */ 2799 /* Clear the mouse highlight in window W, if there is any. */
2805 void (*clear_window_mouse_face) (struct window *w); 2800 void (*clear_window_mouse_face) (struct window *w);
2806 2801
diff --git a/src/dispnew.c b/src/dispnew.c
index 00abf65248c..2b16e881c80 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -783,9 +783,11 @@ clear_current_matrices (register struct frame *f)
783 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix); 783 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->current_matrix);
784#endif 784#endif
785 785
786#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
786 /* Clear the matrix of the tool-bar window, if any. */ 787 /* Clear the matrix of the tool-bar window, if any. */
787 if (WINDOWP (f->tool_bar_window)) 788 if (WINDOWP (f->tool_bar_window))
788 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); 789 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
790#endif
789 791
790 /* Clear current window matrices. */ 792 /* Clear current window matrices. */
791 eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); 793 eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
@@ -806,8 +808,10 @@ clear_desired_matrices (register struct frame *f)
806 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix); 808 clear_glyph_matrix (XWINDOW (f->menu_bar_window)->desired_matrix);
807#endif 809#endif
808 810
811#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
809 if (WINDOWP (f->tool_bar_window)) 812 if (WINDOWP (f->tool_bar_window))
810 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); 813 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix);
814#endif
811 815
812 /* Do it for window matrices. */ 816 /* Do it for window matrices. */
813 eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); 817 eassert (WINDOWP (FRAME_ROOT_WINDOW (f)));
@@ -2041,10 +2045,9 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2041 /* Allocate/reallocate window matrices. */ 2045 /* Allocate/reallocate window matrices. */
2042 allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f))); 2046 allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f)));
2043 2047
2044#ifdef HAVE_X_WINDOWS 2048#if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
2045 /* Allocate/ reallocate matrices of the dummy window used to display 2049 /* Allocate/ reallocate matrices of the dummy window used to display
2046 the menu bar under X when no X toolkit support is available. */ 2050 the menu bar under X when no X toolkit support is available. */
2047#if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
2048 { 2051 {
2049 /* Allocate a dummy window if not already done. */ 2052 /* Allocate a dummy window if not already done. */
2050 struct window *w; 2053 struct window *w;
@@ -2068,10 +2071,9 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2068 w->total_cols = FRAME_TOTAL_COLS (f); 2071 w->total_cols = FRAME_TOTAL_COLS (f);
2069 allocate_matrices_for_window_redisplay (w); 2072 allocate_matrices_for_window_redisplay (w);
2070 } 2073 }
2071#endif /* not USE_X_TOOLKIT && not USE_GTK */ 2074#endif
2072#endif /* HAVE_X_WINDOWS */
2073 2075
2074#ifndef USE_GTK 2076#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
2075 { 2077 {
2076 /* Allocate/ reallocate matrices of the tool bar window. If we 2078 /* Allocate/ reallocate matrices of the tool bar window. If we
2077 don't have a tool bar window yet, make one. */ 2079 don't have a tool bar window yet, make one. */
@@ -2145,6 +2147,7 @@ free_glyphs (struct frame *f)
2145 } 2147 }
2146#endif 2148#endif
2147 2149
2150#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
2148 /* Free the tool bar window and its glyph matrices. */ 2151 /* Free the tool bar window and its glyph matrices. */
2149 if (!NILP (f->tool_bar_window)) 2152 if (!NILP (f->tool_bar_window))
2150 { 2153 {
@@ -2154,6 +2157,7 @@ free_glyphs (struct frame *f)
2154 w->desired_matrix = w->current_matrix = NULL; 2157 w->desired_matrix = w->current_matrix = NULL;
2155 fset_tool_bar_window (f, Qnil); 2158 fset_tool_bar_window (f, Qnil);
2156 } 2159 }
2160#endif
2157 2161
2158 /* Release frame glyph matrices. Reset fields to zero in 2162 /* Release frame glyph matrices. Reset fields to zero in
2159 case we are called a second time. */ 2163 case we are called a second time. */
@@ -3036,6 +3040,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3036 update_window (XWINDOW (f->menu_bar_window), 1); 3040 update_window (XWINDOW (f->menu_bar_window), 1);
3037#endif 3041#endif
3038 3042
3043#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
3039 /* Update the tool-bar window, if present. */ 3044 /* Update the tool-bar window, if present. */
3040 if (WINDOWP (f->tool_bar_window)) 3045 if (WINDOWP (f->tool_bar_window))
3041 { 3046 {
@@ -3056,21 +3061,11 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3056 fset_desired_tool_bar_string (f, tem); 3061 fset_desired_tool_bar_string (f, tem);
3057 } 3062 }
3058 } 3063 }
3059 3064#endif
3060 3065
3061 /* Update windows. */ 3066 /* Update windows. */
3062 paused_p = update_window_tree (root_window, force_p); 3067 paused_p = update_window_tree (root_window, force_p);
3063 update_end (f); 3068 update_end (f);
3064
3065 /* This flush is a performance bottleneck under X,
3066 and it doesn't seem to be necessary anyway (in general).
3067 It is necessary when resizing the window with the mouse, or
3068 at least the fringes are not redrawn in a timely manner. ++kfs */
3069 if (f->force_flush_display_p)
3070 {
3071 FRAME_RIF (f)->flush_display (f);
3072 f->force_flush_display_p = 0;
3073 }
3074 } 3069 }
3075 else 3070 else
3076 { 3071 {
@@ -5498,8 +5493,10 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
5498 if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) 5493 if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
5499 FrameCols (FRAME_TTY (f)) = newwidth; 5494 FrameCols (FRAME_TTY (f)) = newwidth;
5500 5495
5496#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
5501 if (WINDOWP (f->tool_bar_window)) 5497 if (WINDOWP (f->tool_bar_window))
5502 XWINDOW (f->tool_bar_window)->total_cols = newwidth; 5498 XWINDOW (f->tool_bar_window)->total_cols = newwidth;
5499#endif
5503 } 5500 }
5504 5501
5505 FRAME_LINES (f) = newheight; 5502 FRAME_LINES (f) = newheight;
diff --git a/src/emacs.c b/src/emacs.c
index 05384145330..dc4c23b3991 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,7 +1,7 @@
1/* Fully extensible Emacs, running on Unix, intended for GNU. 1/* Fully extensible Emacs, running on Unix, intended for GNU.
2 2
3Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013 Free Software 3Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2013
4Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -310,7 +310,7 @@ example, -batch as well as --batch. You can use any unambiguous\n\
310abbreviation for a --option.\n\ 310abbreviation for a --option.\n\
311\n\ 311\n\
312Various environment variables and window system resources also affect\n\ 312Various environment variables and window system resources also affect\n\
313Emacs' operation. See the main documentation.\n\ 313the operation of Emacs. See the main documentation.\n\
314\n\ 314\n\
315Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\ 315Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\
316section of the Emacs manual or the file BUGS.\n" 316section of the Emacs manual or the file BUGS.\n"
diff --git a/src/eval.c b/src/eval.c
index 9db4d1fd81b..6e964f6604b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2033,7 +2033,9 @@ it is defines a macro. */)
2033 2033
2034DEFUN ("eval", Feval, Seval, 1, 2, 0, 2034DEFUN ("eval", Feval, Seval, 1, 2, 0,
2035 doc: /* Evaluate FORM and return its value. 2035 doc: /* Evaluate FORM and return its value.
2036If LEXICAL is t, evaluate using lexical scoping. */) 2036If LEXICAL is t, evaluate using lexical scoping.
2037LEXICAL can also be an actual lexical environment, in the form of an
2038alist mapping symbols to their value. */)
2037 (Lisp_Object form, Lisp_Object lexical) 2039 (Lisp_Object form, Lisp_Object lexical)
2038{ 2040{
2039 ptrdiff_t count = SPECPDL_INDEX (); 2041 ptrdiff_t count = SPECPDL_INDEX ();
diff --git a/src/fileio.c b/src/fileio.c
index 0e6113f349d..1a2bdfa237c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5121,7 +5121,8 @@ DEFUN ("car-less-than-car", Fcar_less_than_car, Scar_less_than_car, 2, 2, 0,
5121 doc: /* Return t if (car A) is numerically less than (car B). */) 5121 doc: /* Return t if (car A) is numerically less than (car B). */)
5122 (Lisp_Object a, Lisp_Object b) 5122 (Lisp_Object a, Lisp_Object b)
5123{ 5123{
5124 return Flss (Fcar (a), Fcar (b)); 5124 Lisp_Object args[2] = { Fcar (a), Fcar (b), };
5125 return Flss (2, args);
5125} 5126}
5126 5127
5127/* Build the complete list of annotations appropriate for writing out 5128/* Build the complete list of annotations appropriate for writing out
diff --git a/src/frame.c b/src/frame.c
index 0f1560df157..692d224866c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1108,7 +1108,7 @@ other_visible_frames (struct frame *f)
1108 1108
1109 /* Verify that we can still talk to the frame's X window, 1109 /* Verify that we can still talk to the frame's X window,
1110 and note any recent change in visibility. */ 1110 and note any recent change in visibility. */
1111#ifdef HAVE_WINDOW_SYSTEM 1111#ifdef HAVE_X_WINDOWS
1112 if (FRAME_WINDOW_P (XFRAME (this))) 1112 if (FRAME_WINDOW_P (XFRAME (this)))
1113 x_sync (XFRAME (this)); 1113 x_sync (XFRAME (this));
1114#endif 1114#endif
diff --git a/src/frame.h b/src/frame.h
index 3dfbac15709..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. */
@@ -185,10 +187,6 @@ struct frame
185 Clear the frame in clear_garbaged_frames if set. */ 187 Clear the frame in clear_garbaged_frames if set. */
186 unsigned resized_p : 1; 188 unsigned resized_p : 1;
187 189
188 /* Set to non-zero in when we want for force a flush_display in
189 update_frame, usually after resizing the frame. */
190 unsigned force_flush_display_p : 1;
191
192 /* Set to non-zero if the default face for the frame has been 190 /* Set to non-zero if the default face for the frame has been
193 realized. Reset to zero whenever the default face changes. 191 realized. Reset to zero whenever the default face changes.
194 Used to see the difference between a font change and face change. */ 192 Used to see the difference between a font change and face change. */
@@ -201,9 +199,11 @@ struct frame
201 /* Set to non-zero when current redisplay has updated frame. */ 199 /* Set to non-zero when current redisplay has updated frame. */
202 unsigned updated_p : 1; 200 unsigned updated_p : 1;
203 201
202#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
204 /* Set to non-zero to minimize tool-bar height even when 203 /* Set to non-zero to minimize tool-bar height even when
205 auto-resize-tool-bar is set to grow-only. */ 204 auto-resize-tool-bar is set to grow-only. */
206 unsigned minimize_tool_bar_window_p : 1; 205 unsigned minimize_tool_bar_window_p : 1;
206#endif
207 207
208#if defined (USE_GTK) || defined (HAVE_NS) 208#if defined (USE_GTK) || defined (HAVE_NS)
209 /* Nonzero means using a tool bar that comes from the toolkit. */ 209 /* Nonzero means using a tool bar that comes from the toolkit. */
@@ -459,16 +459,6 @@ fset_condemned_scroll_bars (struct frame *f, Lisp_Object val)
459 f->condemned_scroll_bars = val; 459 f->condemned_scroll_bars = val;
460} 460}
461FRAME_INLINE void 461FRAME_INLINE void
462fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
463{
464 f->current_tool_bar_string = val;
465}
466FRAME_INLINE void
467fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
468{
469 f->desired_tool_bar_string = val;
470}
471FRAME_INLINE void
472fset_face_alist (struct frame *f, Lisp_Object val) 462fset_face_alist (struct frame *f, Lisp_Object val)
473{ 463{
474 f->face_alist = val; 464 f->face_alist = val;
@@ -540,11 +530,23 @@ fset_tool_bar_position (struct frame *f, Lisp_Object val)
540{ 530{
541 f->tool_bar_position = val; 531 f->tool_bar_position = val;
542} 532}
533#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
543FRAME_INLINE void 534FRAME_INLINE void
544fset_tool_bar_window (struct frame *f, Lisp_Object val) 535fset_tool_bar_window (struct frame *f, Lisp_Object val)
545{ 536{
546 f->tool_bar_window = val; 537 f->tool_bar_window = val;
547} 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 */
548 550
549#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1) 551#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1)
550 552
@@ -1243,7 +1245,6 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
1243extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p); 1245extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
1244extern void x_set_window_size (struct frame *f, int change_grav, 1246extern void x_set_window_size (struct frame *f, int change_grav,
1245 int cols, int rows); 1247 int cols, int rows);
1246extern void x_sync (struct frame *);
1247extern Lisp_Object x_get_focus_frame (struct frame *); 1248extern Lisp_Object x_get_focus_frame (struct frame *);
1248extern void x_set_mouse_position (struct frame *f, int h, int v); 1249extern void x_set_mouse_position (struct frame *f, int h, int v);
1249extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); 1250extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
@@ -1269,13 +1270,24 @@ extern void x_wm_set_icon_position (struct frame *, int, int);
1269#if !defined USE_X_TOOLKIT 1270#if !defined USE_X_TOOLKIT
1270extern char *x_get_resource_string (const char *, const char *); 1271extern char *x_get_resource_string (const char *, const char *);
1271#endif 1272#endif
1272#endif 1273extern void x_sync (struct frame *);
1274#endif /* HAVE_X_WINDOWS */
1273 1275
1274extern void x_query_colors (struct frame *f, XColor *, int); 1276extern void x_query_colors (struct frame *f, XColor *, int);
1275extern void x_query_color (struct frame *f, XColor *); 1277extern void x_query_color (struct frame *f, XColor *);
1276 1278
1277#endif /* HAVE_WINDOW_SYSTEM */ 1279#endif /* HAVE_WINDOW_SYSTEM */
1278 1280
1281
1282FRAME_INLINE void
1283flush_frame (struct frame *f)
1284{
1285 struct redisplay_interface *rif = FRAME_RIF (f);
1286
1287 if (rif && rif->flush_display)
1288 rif->flush_display (f);
1289}
1290
1279/*********************************************************************** 1291/***********************************************************************
1280 Multimonitor data 1292 Multimonitor data
1281 ***********************************************************************/ 1293 ***********************************************************************/
diff --git a/src/insdel.c b/src/insdel.c
index f746fd34330..ebd096a2927 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1057,6 +1057,9 @@ insert_from_buffer_1 (struct buffer *buf,
1057 ptrdiff_t outgoing_nbytes = incoming_nbytes; 1057 ptrdiff_t outgoing_nbytes = incoming_nbytes;
1058 INTERVAL intervals; 1058 INTERVAL intervals;
1059 1059
1060 if (nchars == 0)
1061 return;
1062
1060 /* Make OUTGOING_NBYTES describe the text 1063 /* Make OUTGOING_NBYTES describe the text
1061 as it will be inserted in this buffer. */ 1064 as it will be inserted in this buffer. */
1062 1065
diff --git a/src/keyboard.c b/src/keyboard.c
index ed70e288c84..020c8859941 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2596,10 +2596,8 @@ read_char (int commandflag, Lisp_Object map,
2596 2596
2597 if (/* There currently is something in the echo area. */ 2597 if (/* There currently is something in the echo area. */
2598 !NILP (echo_area_buffer[0]) 2598 !NILP (echo_area_buffer[0])
2599 && (/* And it's either not from echoing. */ 2599 && (/* It's an echo from a different kboard. */
2600 !EQ (echo_area_buffer[0], echo_message_buffer) 2600 echo_kboard != current_kboard
2601 /* Or it's an echo from a different kboard. */
2602 || echo_kboard != current_kboard
2603 /* Or we explicitly allow overwriting whatever there is. */ 2601 /* Or we explicitly allow overwriting whatever there is. */
2604 || ok_to_echo_at_next_pause == NULL)) 2602 || ok_to_echo_at_next_pause == NULL))
2605 cancel_echoing (); 2603 cancel_echoing ();
@@ -9873,20 +9871,7 @@ detect_input_pending_run_timers (bool do_display)
9873 get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW); 9871 get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
9874 9872
9875 if (old_timers_run != timers_run && do_display) 9873 if (old_timers_run != timers_run && do_display)
9876 { 9874 redisplay_preserve_echo_area (8);
9877 redisplay_preserve_echo_area (8);
9878 /* The following fixes a bug when using lazy-lock with
9879 lazy-lock-defer-on-the-fly set to t, i.e. when fontifying
9880 from an idle timer function. The symptom of the bug is that
9881 the cursor sometimes doesn't become visible until the next X
9882 event is processed. --gerd. */
9883 {
9884 Lisp_Object tail, frame;
9885 FOR_EACH_FRAME (tail, frame)
9886 if (FRAME_RIF (XFRAME (frame)))
9887 FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame));
9888 }
9889 }
9890 9875
9891 return input_pending; 9876 return input_pending;
9892} 9877}
diff --git a/src/lisp.h b/src/lisp.h
index 38b538d9bc2..2b1af1faa19 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3160,6 +3160,16 @@ EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST;
3160/* Defined in data.c. */ 3160/* Defined in data.c. */
3161extern Lisp_Object indirect_function (Lisp_Object); 3161extern Lisp_Object indirect_function (Lisp_Object);
3162extern Lisp_Object find_symbol_value (Lisp_Object); 3162extern Lisp_Object find_symbol_value (Lisp_Object);
3163enum Arith_Comparison {
3164 ARITH_EQUAL,
3165 ARITH_NOTEQUAL,
3166 ARITH_LESS,
3167 ARITH_GRTR,
3168 ARITH_LESS_OR_EQUAL,
3169 ARITH_GRTR_OR_EQUAL
3170};
3171extern Lisp_Object arithcompare (Lisp_Object num1, Lisp_Object num2,
3172 enum Arith_Comparison comparison);
3163 3173
3164/* Convert the integer I to an Emacs representation, either the integer 3174/* Convert the integer I to an Emacs representation, either the integer
3165 itself, or a cons of two or three integers, or if all else fails a float. 3175 itself, or a cons of two or three integers, or if all else fails a float.
diff --git a/src/minibuf.c b/src/minibuf.c
index 7403fc6c32d..cc6f234f7da 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -672,12 +672,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
672 XWINDOW (minibuf_window)->cursor.x = 0; 672 XWINDOW (minibuf_window)->cursor.x = 0;
673 XWINDOW (minibuf_window)->must_be_updated_p = 1; 673 XWINDOW (minibuf_window)->must_be_updated_p = 1;
674 update_frame (XFRAME (selected_frame), 1, 1); 674 update_frame (XFRAME (selected_frame), 1, 1);
675 { 675 flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
676 struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
677 struct redisplay_interface *rif = FRAME_RIF (f);
678 if (rif && rif->flush_display)
679 rif->flush_display (f);
680 }
681 } 676 }
682 677
683 /* Make minibuffer contents into a string. */ 678 /* Make minibuffer contents into a string. */
diff --git a/src/nsfns.m b/src/nsfns.m
index fc276c2b12d..f021e834d59 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2231,15 +2231,6 @@ x_get_focus_frame (struct frame *frame)
2231 return nsfocus; 2231 return nsfocus;
2232} 2232}
2233 2233
2234void
2235x_sync (struct frame *f)
2236{
2237 /* XXX Not implemented XXX */
2238 return;
2239}
2240
2241
2242
2243/* ========================================================================== 2234/* ==========================================================================
2244 2235
2245 Lisp definitions that, for whatever reason, we can't alias as 'ns-XXX'. 2236 Lisp definitions that, for whatever reason, we can't alias as 'ns-XXX'.
diff --git a/src/nsterm.m b/src/nsterm.m
index 31053ca7a0d..59627a38087 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -801,18 +801,6 @@ ns_update_end (struct frame *f)
801 NSTRACE (ns_update_end); 801 NSTRACE (ns_update_end);
802} 802}
803 803
804
805static void
806ns_flush (struct frame *f)
807/* --------------------------------------------------------------------------
808 external (RIF) call
809 NS impl is no-op since currently we flush in ns_update_end and elsewhere
810 -------------------------------------------------------------------------- */
811{
812 NSTRACE (ns_flush);
813}
814
815
816static void 804static void
817ns_focus (struct frame *f, NSRect *r, int n) 805ns_focus (struct frame *f, NSRect *r, int n)
818/* -------------------------------------------------------------------------- 806/* --------------------------------------------------------------------------
@@ -3963,8 +3951,7 @@ static struct redisplay_interface ns_redisplay_interface =
3963 ns_after_update_window_line, 3951 ns_after_update_window_line,
3964 ns_update_window_begin, 3952 ns_update_window_begin,
3965 ns_update_window_end, 3953 ns_update_window_end,
3966 ns_flush, 3954 0, /* flush_display */
3967 0, /* flush_display_optional */
3968 x_clear_window_mouse_face, 3955 x_clear_window_mouse_face,
3969 x_get_glyph_overhangs, 3956 x_get_glyph_overhangs,
3970 x_fix_overlapping_area, 3957 x_fix_overlapping_area,
@@ -7446,6 +7433,6 @@ variable `x-use-underline-position-properties', which is usually at the
7446baseline level. The default value is nil. */); 7433baseline level. The default value is nil. */);
7447 x_underline_at_descent_line = 0; 7434 x_underline_at_descent_line = 0;
7448 7435
7449 /* Tell emacs about this window system. */ 7436 /* Tell Emacs about this window system. */
7450 Fprovide (intern ("ns"), Qnil); 7437 Fprovide (Qns, Qnil);
7451} 7438}
diff --git a/src/term.c b/src/term.c
index 0270c1eefa6..fd5ea5a1b8d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2917,12 +2917,8 @@ dissociate_if_controlling_tty (int fd)
2917struct terminal * 2917struct terminal *
2918init_tty (const char *name, const char *terminal_type, bool must_succeed) 2918init_tty (const char *name, const char *terminal_type, bool must_succeed)
2919{ 2919{
2920#ifdef TERMINFO
2921 char **address = 0;
2922#else
2923 char *area; 2920 char *area;
2924 char **address = &area; 2921 char **address = &area;
2925#endif
2926 int status; 2922 int status;
2927 struct tty_display_info *tty = NULL; 2923 struct tty_display_info *tty = NULL;
2928 struct terminal *terminal = NULL; 2924 struct terminal *terminal = NULL;
@@ -3013,13 +3009,9 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
3013 /* On some systems, tgetent tries to access the controlling 3009 /* On some systems, tgetent tries to access the controlling
3014 terminal. */ 3010 terminal. */
3015 block_tty_out_signal (); 3011 block_tty_out_signal ();
3016#ifdef TERMINFO
3017 status = tgetent (0, terminal_type);
3018#else
3019 status = tgetent (tty->termcap_term_buffer, terminal_type); 3012 status = tgetent (tty->termcap_term_buffer, terminal_type);
3020 if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1]) 3013 if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1])
3021 emacs_abort (); 3014 emacs_abort ();
3022#endif
3023 unblock_tty_out_signal (); 3015 unblock_tty_out_signal ();
3024 3016
3025 if (status < 0) 3017 if (status < 0)
@@ -3050,9 +3042,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3050 terminal_type); 3042 terminal_type);
3051 } 3043 }
3052 3044
3053#ifndef TERMINFO
3054 area = tty->termcap_strings_buffer; 3045 area = tty->termcap_strings_buffer;
3055#endif
3056 tty->TS_ins_line = tgetstr ("al", address); 3046 tty->TS_ins_line = tgetstr ("al", address);
3057 tty->TS_ins_multi_lines = tgetstr ("AL", address); 3047 tty->TS_ins_multi_lines = tgetstr ("AL", address);
3058 tty->TS_bell = tgetstr ("bl", address); 3048 tty->TS_bell = tgetstr ("bl", address);
diff --git a/src/termchar.h b/src/termchar.h
index 687f7fbd119..11cea34df23 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -30,9 +30,7 @@ struct tty_output
30 /* There is nothing else here at the moment... */ 30 /* There is nothing else here at the moment... */
31}; 31};
32 32
33#ifndef TERMINFO
34enum { TERMCAP_BUFFER_SIZE = 4096 }; 33enum { TERMCAP_BUFFER_SIZE = 4096 };
35#endif
36 34
37/* Parameters that are shared between frames on the same tty device. */ 35/* Parameters that are shared between frames on the same tty device. */
38 36
@@ -78,7 +76,6 @@ struct tty_display_info
78 mouse-face. */ 76 mouse-face. */
79 Mouse_HLInfo mouse_highlight; 77 Mouse_HLInfo mouse_highlight;
80 78
81#ifndef TERMINFO
82 /* Buffer used internally by termcap (see tgetent in the Termcap 79 /* Buffer used internally by termcap (see tgetent in the Termcap
83 manual). Only init_tty should use this. */ 80 manual). Only init_tty should use this. */
84 char termcap_term_buffer[TERMCAP_BUFFER_SIZE]; 81 char termcap_term_buffer[TERMCAP_BUFFER_SIZE];
@@ -86,7 +83,6 @@ struct tty_display_info
86 /* Buffer storing terminal description strings (see tgetstr in the 83 /* Buffer storing terminal description strings (see tgetstr in the
87 Termcap manual). Only init_tty should use this. */ 84 Termcap manual). Only init_tty should use this. */
88 char termcap_strings_buffer[TERMCAP_BUFFER_SIZE]; 85 char termcap_strings_buffer[TERMCAP_BUFFER_SIZE];
89#endif
90 86
91 /* Strings, numbers and flags taken from the termcap entry. */ 87 /* Strings, numbers and flags taken from the termcap entry. */
92 88
diff --git a/src/termhooks.h b/src/termhooks.h
index 77f98938edb..a050c3292c2 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -31,6 +31,7 @@ INLINE_HEADER_BEGIN
31#endif 31#endif
32 32
33enum scroll_bar_part { 33enum scroll_bar_part {
34 scroll_bar_nowhere = -1,
34 scroll_bar_above_handle, 35 scroll_bar_above_handle,
35 scroll_bar_handle, 36 scroll_bar_handle,
36 scroll_bar_below_handle, 37 scroll_bar_below_handle,
@@ -42,11 +43,6 @@ enum scroll_bar_part {
42 scroll_bar_move_ratio 43 scroll_bar_move_ratio
43}; 44};
44 45
45/* If the value of the frame parameter changed, whis hook is called.
46 For example, if going from fullscreen to not fullscreen this hook
47 may do something OS dependent, like extended window manager hints on X11. */
48extern void (*fullscreen_hook) (struct frame *f);
49
50/* Output method of a terminal (and frames on this terminal, respectively). */ 46/* Output method of a terminal (and frames on this terminal, respectively). */
51 47
52enum output_method 48enum output_method
@@ -498,7 +494,7 @@ struct terminal
498 windows. */ 494 windows. */
499 void (*frame_raise_lower_hook) (struct frame *f, int raise_flag); 495 void (*frame_raise_lower_hook) (struct frame *f, int raise_flag);
500 496
501 /* If the value of the frame parameter changed, whis hook is called. 497 /* If the value of the frame parameter changed, this hook is called.
502 For example, if going from fullscreen to not fullscreen this hook 498 For example, if going from fullscreen to not fullscreen this hook
503 may do something OS dependent, like extended window manager hints on X11. */ 499 may do something OS dependent, like extended window manager hints on X11. */
504 void (*fullscreen_hook) (struct frame *f); 500 void (*fullscreen_hook) (struct frame *f);
diff --git a/src/w32fns.c b/src/w32fns.c
index 58c63d959ef..a8b444e0409 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5201,11 +5201,6 @@ terminate Emacs if we can't open the connection.
5201 if (! NILP (xrm_string)) 5201 if (! NILP (xrm_string))
5202 CHECK_STRING (xrm_string); 5202 CHECK_STRING (xrm_string);
5203 5203
5204#if 0
5205 if (! EQ (Vwindow_system, intern ("w32")))
5206 error ("Not using Microsoft Windows");
5207#endif
5208
5209 /* Allow color mapping to be defined externally; first look in user's 5204 /* Allow color mapping to be defined externally; first look in user's
5210 HOME directory, then in Emacs etc dir for a file called rgb.txt. */ 5205 HOME directory, then in Emacs etc dir for a file called rgb.txt. */
5211 { 5206 {
diff --git a/src/w32proc.c b/src/w32proc.c
index dabaa62f71c..221b42fb7b2 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1144,7 +1144,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app,
1144 return FALSE; 1144 return FALSE;
1145} 1145}
1146 1146
1147/* create_child doesn't know what emacs' file handle will be for waiting 1147/* create_child doesn't know what emacs's file handle will be for waiting
1148 on output from the child, so we need to make this additional call 1148 on output from the child, so we need to make this additional call
1149 to register the handle with the process 1149 to register the handle with the process
1150 This way the select emulator knows how to match file handles with 1150 This way the select emulator knows how to match file handles with
diff --git a/src/w32term.c b/src/w32term.c
index 532ded7cdad..d47509e4ece 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6258,11 +6258,6 @@ w32_make_rdb (char *xrm_option)
6258 return buffer; 6258 return buffer;
6259} 6259}
6260 6260
6261void
6262x_flush (struct frame * f)
6263{ /* Nothing to do */ }
6264
6265
6266extern frame_parm_handler w32_frame_parm_handlers[]; 6261extern frame_parm_handler w32_frame_parm_handlers[];
6267 6262
6268static struct redisplay_interface w32_redisplay_interface = 6263static struct redisplay_interface w32_redisplay_interface =
@@ -6276,8 +6271,7 @@ static struct redisplay_interface w32_redisplay_interface =
6276 x_after_update_window_line, 6271 x_after_update_window_line,
6277 x_update_window_begin, 6272 x_update_window_begin,
6278 x_update_window_end, 6273 x_update_window_end,
6279 x_flush, 6274 0, /* flush_display */
6280 0, /* flush_display_optional */
6281 x_clear_window_mouse_face, 6275 x_clear_window_mouse_face,
6282 x_get_glyph_overhangs, 6276 x_get_glyph_overhangs,
6283 x_fix_overlapping_area, 6277 x_fix_overlapping_area,
@@ -6344,7 +6338,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6344 terminal like X does. */ 6338 terminal like X does. */
6345 terminal->kboard = xmalloc (sizeof (KBOARD)); 6339 terminal->kboard = xmalloc (sizeof (KBOARD));
6346 init_kboard (terminal->kboard); 6340 init_kboard (terminal->kboard);
6347 kset_window_system (terminal->kboard, intern ("w32")); 6341 kset_window_system (terminal->kboard, Qw32);
6348 terminal->kboard->next_kboard = all_kboards; 6342 terminal->kboard->next_kboard = all_kboards;
6349 all_kboards = terminal->kboard; 6343 all_kboards = terminal->kboard;
6350 /* Don't let the initial kboard remain current longer than necessary. 6344 /* Don't let the initial kboard remain current longer than necessary.
@@ -6697,5 +6691,6 @@ With MS Windows or Nextstep, the value is t. */);
6697 staticpro (&last_mouse_motion_frame); 6691 staticpro (&last_mouse_motion_frame);
6698 last_mouse_motion_frame = Qnil; 6692 last_mouse_motion_frame = Qnil;
6699 6693
6700 Fprovide (intern_c_string ("w32"), Qnil); 6694 /* Tell Emacs about this window system. */
6695 Fprovide (Qw32, Qnil);
6701} 6696}
diff --git a/src/w32term.h b/src/w32term.h
index 41c5c71832a..b4818f69aee 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -211,7 +211,6 @@ extern void x_set_window_size (struct frame *f, int change_grav,
211 int cols, int rows); 211 int cols, int rows);
212extern int x_display_pixel_height (struct w32_display_info *); 212extern int x_display_pixel_height (struct w32_display_info *);
213extern int x_display_pixel_width (struct w32_display_info *); 213extern int x_display_pixel_width (struct w32_display_info *);
214extern void x_sync (struct frame *);
215extern Lisp_Object x_get_focus_frame (struct frame *); 214extern Lisp_Object x_get_focus_frame (struct frame *);
216extern void x_set_mouse_position (struct frame *f, int h, int v); 215extern void x_set_mouse_position (struct frame *f, int h, int v);
217extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); 216extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 19c6b72bf89..7629e49caf8 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -333,9 +333,3 @@ drain_message_queue (void)
333 } 333 }
334 return retval; 334 return retval;
335} 335}
336
337/* x_sync is a no-op on W32. */
338void
339x_sync (struct frame *f)
340{
341}
diff --git a/src/window.c b/src/window.c
index 6a52ed7e166..677cb991025 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1379,6 +1379,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1379 cw.window = &window, cw.x = x, cw.y = y; cw.part = part; 1379 cw.window = &window, cw.x = x, cw.y = y; cw.part = part;
1380 foreach_window (f, check_window_containing, &cw); 1380 foreach_window (f, check_window_containing, &cw);
1381 1381
1382#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
1382 /* If not found above, see if it's in the tool bar window, if a tool 1383 /* If not found above, see if it's in the tool bar window, if a tool
1383 bar exists. */ 1384 bar exists. */
1384 if (NILP (window) 1385 if (NILP (window)
@@ -1391,6 +1392,7 @@ window_from_coordinates (struct frame *f, int x, int y,
1391 *part = ON_TEXT; 1392 *part = ON_TEXT;
1392 window = f->tool_bar_window; 1393 window = f->tool_bar_window;
1393 } 1394 }
1395#endif
1394 1396
1395 return window; 1397 return window;
1396} 1398}
@@ -5112,9 +5114,9 @@ and redisplay normally--don't erase and redraw the frame. */)
5112 /* Invalidate pixel data calculated for all compositions. */ 5114 /* Invalidate pixel data calculated for all compositions. */
5113 for (i = 0; i < n_compositions; i++) 5115 for (i = 0; i < n_compositions; i++)
5114 composition_table[i]->font = NULL; 5116 composition_table[i]->font = NULL;
5115 5117#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
5116 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; 5118 WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1;
5117 5119#endif
5118 Fredraw_frame (WINDOW_FRAME (w)); 5120 Fredraw_frame (WINDOW_FRAME (w));
5119 SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); 5121 SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
5120 } 5122 }
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 d5def065936..58316a0667f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -913,11 +913,8 @@ static int in_ellipses_for_invisible_text_p (struct display_pos *,
913#ifdef HAVE_WINDOW_SYSTEM 913#ifdef HAVE_WINDOW_SYSTEM
914 914
915static void x_consider_frame_title (Lisp_Object); 915static void x_consider_frame_title (Lisp_Object);
916static int tool_bar_lines_needed (struct frame *, int *);
917static void update_tool_bar (struct frame *, int); 916static void update_tool_bar (struct frame *, int);
918static void build_desired_tool_bar_string (struct frame *f);
919static int redisplay_tool_bar (struct frame *); 917static int redisplay_tool_bar (struct frame *);
920static void display_tool_bar_line (struct it *, int);
921static void notice_overwritten_cursor (struct window *, 918static void notice_overwritten_cursor (struct window *,
922 enum glyph_row_area, 919 enum glyph_row_area,
923 int, int, int, int); 920 int, int, int, int);
@@ -10767,11 +10764,9 @@ clear_garbaged_frames (void)
10767 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) 10764 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
10768 { 10765 {
10769 if (f->resized_p) 10766 if (f->resized_p)
10770 { 10767 redraw_frame (f);
10771 redraw_frame (f); 10768 else
10772 f->force_flush_display_p = 1; 10769 clear_current_matrices (f);
10773 }
10774 clear_current_matrices (f);
10775 changed_count++; 10770 changed_count++;
10776 f->garbaged = 0; 10771 f->garbaged = 0;
10777 f->resized_p = 0; 10772 f->resized_p = 0;
@@ -10859,7 +10854,7 @@ echo_area_display (int update_frame_p)
10859 Can do with a display update of the echo area, 10854 Can do with a display update of the echo area,
10860 unless we displayed some mode lines. */ 10855 unless we displayed some mode lines. */
10861 update_single_window (w, 1); 10856 update_single_window (w, 1);
10862 FRAME_RIF (f)->flush_display (f); 10857 flush_frame (f);
10863 } 10858 }
10864 else 10859 else
10865 update_frame (f, 1, 1); 10860 update_frame (f, 1, 1);
@@ -11568,6 +11563,7 @@ update_tool_bar (struct frame *f, int save_match_data)
11568 } 11563 }
11569} 11564}
11570 11565
11566#if ! defined (USE_GTK) && ! defined (HAVE_NS)
11571 11567
11572/* Set F->desired_tool_bar_string to a Lisp string representing frame 11568/* Set F->desired_tool_bar_string to a Lisp string representing frame
11573 F's desired tool-bar contents. F->tool_bar_items must have 11569 F's desired tool-bar contents. F->tool_bar_items must have
@@ -11905,6 +11901,11 @@ tool_bar_lines_needed (struct frame *f, int *n_rows)
11905 return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); 11901 return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
11906} 11902}
11907 11903
11904#endif /* !USE_GTK && !HAVE_NS */
11905
11906#if defined USE_GTK || defined HAVE_NS
11907EXFUN (Ftool_bar_lines_needed, 1) ATTRIBUTE_CONST;
11908#endif
11908 11909
11909DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 11910DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
11910 0, 1, 0, 11911 0, 1, 0,
@@ -11912,9 +11913,10 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
11912If FRAME is nil or omitted, use the selected frame. */) 11913If FRAME is nil or omitted, use the selected frame. */)
11913 (Lisp_Object frame) 11914 (Lisp_Object frame)
11914{ 11915{
11916 int nlines = 0;
11917#if ! defined (USE_GTK) && ! defined (HAVE_NS)
11915 struct frame *f = decode_any_frame (frame); 11918 struct frame *f = decode_any_frame (frame);
11916 struct window *w; 11919 struct window *w;
11917 int nlines = 0;
11918 11920
11919 if (WINDOWP (f->tool_bar_window) 11921 if (WINDOWP (f->tool_bar_window)
11920 && (w = XWINDOW (f->tool_bar_window), 11922 && (w = XWINDOW (f->tool_bar_window),
@@ -11927,7 +11929,7 @@ If FRAME is nil or omitted, use the selected frame. */)
11927 nlines = tool_bar_lines_needed (f, NULL); 11929 nlines = tool_bar_lines_needed (f, NULL);
11928 } 11930 }
11929 } 11931 }
11930 11932#endif
11931 return make_number (nlines); 11933 return make_number (nlines);
11932} 11934}
11933 11935
@@ -11938,15 +11940,17 @@ If FRAME is nil or omitted, use the selected frame. */)
11938static int 11940static int
11939redisplay_tool_bar (struct frame *f) 11941redisplay_tool_bar (struct frame *f)
11940{ 11942{
11941 struct window *w;
11942 struct it it;
11943 struct glyph_row *row;
11944
11945#if defined (USE_GTK) || defined (HAVE_NS) 11943#if defined (USE_GTK) || defined (HAVE_NS)
11944
11946 if (FRAME_EXTERNAL_TOOL_BAR (f)) 11945 if (FRAME_EXTERNAL_TOOL_BAR (f))
11947 update_frame_tool_bar (f); 11946 update_frame_tool_bar (f);
11948 return 0; 11947 return 0;
11949#endif 11948
11949#else /* !USE_GTK && !HAVE_NS */
11950
11951 struct window *w;
11952 struct it it;
11953 struct glyph_row *row;
11950 11954
11951 /* If frame hasn't a tool-bar window or if it is zero-height, don't 11955 /* If frame hasn't a tool-bar window or if it is zero-height, don't
11952 do anything. This means you must start with tool-bar-lines 11956 do anything. This means you must start with tool-bar-lines
@@ -12102,8 +12106,11 @@ redisplay_tool_bar (struct frame *f)
12102 12106
12103 f->minimize_tool_bar_window_p = 0; 12107 f->minimize_tool_bar_window_p = 0;
12104 return 0; 12108 return 0;
12109
12110#endif /* USE_GTK || HAVE_NS */
12105} 12111}
12106 12112
12113#if ! defined (USE_GTK) && ! defined (HAVE_NS)
12107 12114
12108/* Get information about the tool-bar item which is displayed in GLYPH 12115/* Get information about the tool-bar item which is displayed in GLYPH
12109 on frame F. Return in *PROP_IDX the index where tool-bar item 12116 on frame F. Return in *PROP_IDX the index where tool-bar item
@@ -12347,6 +12354,8 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12347 help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION); 12354 help_echo_string = AREF (f->tool_bar_items, prop_idx + TOOL_BAR_ITEM_CAPTION);
12348} 12355}
12349 12356
12357#endif /* !USE_GTK && !HAVE_NS */
12358
12350#endif /* HAVE_WINDOW_SYSTEM */ 12359#endif /* HAVE_WINDOW_SYSTEM */
12351 12360
12352 12361
@@ -13645,9 +13654,7 @@ redisplay_preserve_echo_area (int from_where)
13645 else 13654 else
13646 redisplay_internal (); 13655 redisplay_internal ();
13647 13656
13648 if (FRAME_RIF (SELECTED_FRAME ()) != NULL 13657 flush_frame (SELECTED_FRAME ());
13649 && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
13650 FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
13651} 13658}
13652 13659
13653 13660
@@ -26695,10 +26702,13 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
26695 /* Change the mouse cursor. */ 26702 /* Change the mouse cursor. */
26696 if (FRAME_WINDOW_P (f)) 26703 if (FRAME_WINDOW_P (f))
26697 { 26704 {
26705#if ! defined (USE_GTK) && ! defined (HAVE_NS)
26698 if (draw == DRAW_NORMAL_TEXT 26706 if (draw == DRAW_NORMAL_TEXT
26699 && !EQ (hlinfo->mouse_face_window, f->tool_bar_window)) 26707 && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
26700 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor); 26708 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
26701 else if (draw == DRAW_MOUSE_FACE) 26709 else
26710#endif
26711 if (draw == DRAW_MOUSE_FACE)
26702 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor); 26712 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
26703 else 26713 else
26704 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor); 26714 FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
@@ -28036,7 +28046,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28036 w = XWINDOW (window); 28046 w = XWINDOW (window);
28037 frame_to_window_pixel_xy (w, &x, &y); 28047 frame_to_window_pixel_xy (w, &x, &y);
28038 28048
28039#ifdef HAVE_WINDOW_SYSTEM 28049#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
28040 /* Handle tool-bar window differently since it doesn't display a 28050 /* Handle tool-bar window differently since it doesn't display a
28041 buffer. */ 28051 buffer. */
28042 if (EQ (window, f->tool_bar_window)) 28052 if (EQ (window, f->tool_bar_window))
@@ -28949,9 +28959,11 @@ expose_frame (struct frame *f, int x, int y, int w, int h)
28949 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height)); 28959 TRACE ((stderr, "(%d, %d, %d, %d)\n", r.x, r.y, r.width, r.height));
28950 mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r); 28960 mouse_face_overwritten_p = expose_window_tree (XWINDOW (f->root_window), &r);
28951 28961
28962#if ! defined (USE_GTK) && ! defined (HAVE_NS)
28952 if (WINDOWP (f->tool_bar_window)) 28963 if (WINDOWP (f->tool_bar_window))
28953 mouse_face_overwritten_p 28964 mouse_face_overwritten_p
28954 |= expose_window (XWINDOW (f->tool_bar_window), &r); 28965 |= expose_window (XWINDOW (f->tool_bar_window), &r);
28966#endif
28955 28967
28956#ifdef HAVE_X_WINDOWS 28968#ifdef HAVE_X_WINDOWS
28957#ifndef MSDOS 28969#ifndef MSDOS
diff --git a/src/xfns.c b/src/xfns.c
index 4e8442dd3a3..74bc7a8b1d0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1031,7 +1031,7 @@ x_set_border_pixel (struct frame *f, int pix)
1031 Note: this is done in two routines because of the way X10 works. 1031 Note: this is done in two routines because of the way X10 works.
1032 1032
1033 Note: under X11, this is normally the province of the window manager, 1033 Note: under X11, this is normally the province of the window manager,
1034 and so emacs' border colors may be overridden. */ 1034 and so emacs's border colors may be overridden. */
1035 1035
1036static void 1036static void
1037x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 1037x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
@@ -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
@@ -4431,11 +4434,6 @@ x_display_info_for_name (Lisp_Object name)
4431 4434
4432 CHECK_STRING (name); 4435 CHECK_STRING (name);
4433 4436
4434#if 0
4435 if (! EQ (Vinitial_window_system, intern ("x")))
4436 error ("Not using X Windows"); /* That doesn't stop us anymore. */
4437#endif
4438
4439 for (dpyinfo = x_display_list, names = x_display_name_list; 4437 for (dpyinfo = x_display_list, names = x_display_name_list;
4440 dpyinfo; 4438 dpyinfo;
4441 dpyinfo = dpyinfo->next, names = XCDR (names)) 4439 dpyinfo = dpyinfo->next, names = XCDR (names))
@@ -4479,11 +4477,6 @@ terminate Emacs if we can't open the connection.
4479 if (! NILP (xrm_string)) 4477 if (! NILP (xrm_string))
4480 CHECK_STRING (xrm_string); 4478 CHECK_STRING (xrm_string);
4481 4479
4482#if 0
4483 if (! EQ (Vinitial_window_system, intern ("x")))
4484 error ("Not using X Windows"); /* That doesn't stop us anymore. */
4485#endif
4486
4487 xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string); 4480 xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string);
4488 4481
4489 validate_x_resource_name (); 4482 validate_x_resource_name ();
@@ -6296,7 +6289,8 @@ Otherwise use Emacs own tooltip implementation.
6296When using Gtk+ tooltips, the tooltip face is not used. */); 6289When using Gtk+ tooltips, the tooltip face is not used. */);
6297 x_gtk_use_system_tooltips = 1; 6290 x_gtk_use_system_tooltips = 1;
6298 6291
6299 Fprovide (intern_c_string ("x"), Qnil); 6292 /* Tell Emacs about this window system. */
6293 Fprovide (Qx, Qnil);
6300 6294
6301#ifdef USE_X_TOOLKIT 6295#ifdef USE_X_TOOLKIT
6302 Fprovide (intern_c_string ("x-toolkit"), Qnil); 6296 Fprovide (intern_c_string ("x-toolkit"), Qnil);
diff --git a/src/xterm.c b/src/xterm.c
index 2f3d5ca7a01..c28ca824063 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -230,10 +230,6 @@ static Lisp_Object last_mouse_scroll_bar;
230 230
231static Time last_mouse_movement_time; 231static Time last_mouse_movement_time;
232 232
233/* Time for last user interaction as returned in X events. */
234
235static Time last_user_time;
236
237/* Incremented by XTread_socket whenever it really tries to read 233/* Incremented by XTread_socket whenever it really tries to read
238 events. */ 234 events. */
239 235
@@ -334,29 +330,19 @@ static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t);
334static void x_initialize (void); 330static void x_initialize (void);
335 331
336 332
337/* Flush display of frame F, or of all frames if F is null. */ 333/* Flush display of frame F. */
338 334
339static void 335static void
340x_flush (struct frame *f) 336x_flush (struct frame *f)
341{ 337{
338 eassert (f && FRAME_X_P (f));
342 /* Don't call XFlush when it is not safe to redisplay; the X 339 /* Don't call XFlush when it is not safe to redisplay; the X
343 connection may be broken. */ 340 connection may be broken. */
344 if (!NILP (Vinhibit_redisplay)) 341 if (!NILP (Vinhibit_redisplay))
345 return; 342 return;
346 343
347 block_input (); 344 block_input ();
348 if (f) 345 XFlush (FRAME_X_DISPLAY (f));
349 {
350 eassert (FRAME_X_P (f));
351 XFlush (FRAME_X_DISPLAY (f));
352 }
353 else
354 {
355 /* Flush all displays and so all frames on them. */
356 struct x_display_info *xdi;
357 for (xdi = x_display_list; xdi; xdi = xdi->next)
358 XFlush (xdi->display);
359 }
360 unblock_input (); 346 unblock_input ();
361} 347}
362 348
@@ -4091,10 +4077,6 @@ static void x_set_toolkit_scroll_bar_thumb (struct scroll_bar *,
4091 4077
4092static Lisp_Object window_being_scrolled; 4078static Lisp_Object window_being_scrolled;
4093 4079
4094/* Last scroll bar part sent in xm_scroll_callback. */
4095
4096static int last_scroll_bar_part;
4097
4098/* Whether this is an Xaw with arrow-scrollbars. This should imply 4080/* Whether this is an Xaw with arrow-scrollbars. This should imply
4099 that movements of 1/20 of the screen size are mapped to up/down. */ 4081 that movements of 1/20 of the screen size are mapped to up/down. */
4100 4082
@@ -4136,20 +4118,23 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
4136 && WINDOWP (window_being_scrolled)) 4118 && WINDOWP (window_being_scrolled))
4137 { 4119 {
4138 struct window *w; 4120 struct window *w;
4121 struct scroll_bar *bar;
4139 4122
4140 x_send_scroll_bar_event (window_being_scrolled, 4123 x_send_scroll_bar_event (window_being_scrolled,
4141 scroll_bar_end_scroll, 0, 0); 4124 scroll_bar_end_scroll, 0, 0);
4142 w = XWINDOW (window_being_scrolled); 4125 w = XWINDOW (window_being_scrolled);
4126 bar = XSCROLL_BAR (w->vertical_scroll_bar);
4143 4127
4144 if (XSCROLL_BAR (w->vertical_scroll_bar)->dragging != -1) 4128 if (bar->dragging != -1)
4145 { 4129 {
4146 XSCROLL_BAR (w->vertical_scroll_bar)->dragging = -1; 4130 bar->dragging = -1;
4147 /* The thumb size is incorrect while dragging: fix it. */ 4131 /* The thumb size is incorrect while dragging: fix it. */
4148 set_vertical_scroll_bar (w); 4132 set_vertical_scroll_bar (w);
4149 } 4133 }
4150 window_being_scrolled = Qnil; 4134 window_being_scrolled = Qnil;
4151 last_scroll_bar_part = -1; 4135#if defined (USE_LUCID)
4152 4136 bar->last_seen_part = scroll_bar_nowhere;
4137#endif
4153 /* Xt timeouts no longer needed. */ 4138 /* Xt timeouts no longer needed. */
4154 toolkit_scroll_bar_interaction = 0; 4139 toolkit_scroll_bar_interaction = 0;
4155 } 4140 }
@@ -4333,7 +4318,6 @@ xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
4333 if (part >= 0) 4318 if (part >= 0)
4334 { 4319 {
4335 window_being_scrolled = bar->window; 4320 window_being_scrolled = bar->window;
4336 last_scroll_bar_part = part;
4337 x_send_scroll_bar_event (bar->window, part, portion, whole); 4321 x_send_scroll_bar_event (bar->window, part, portion, whole);
4338 } 4322 }
4339} 4323}
@@ -4394,7 +4378,6 @@ xg_scroll_callback (GtkRange *range,
4394 if (part >= 0) 4378 if (part >= 0)
4395 { 4379 {
4396 window_being_scrolled = bar->window; 4380 window_being_scrolled = bar->window;
4397 last_scroll_bar_part = part;
4398 x_send_scroll_bar_event (bar->window, part, portion, whole); 4381 x_send_scroll_bar_event (bar->window, part, portion, whole);
4399 } 4382 }
4400 4383
@@ -4436,7 +4419,7 @@ xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
4436 float top = *top_addr; 4419 float top = *top_addr;
4437 float shown; 4420 float shown;
4438 int whole, portion, height; 4421 int whole, portion, height;
4439 int part; 4422 enum scroll_bar_part part;
4440 4423
4441 /* Get the size of the thumb, a value between 0 and 1. */ 4424 /* Get the size of the thumb, a value between 0 and 1. */
4442 block_input (); 4425 block_input ();
@@ -4458,7 +4441,7 @@ xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
4458 4441
4459 window_being_scrolled = bar->window; 4442 window_being_scrolled = bar->window;
4460 bar->dragging = portion; 4443 bar->dragging = portion;
4461 last_scroll_bar_part = part; 4444 bar->last_seen_part = part;
4462 x_send_scroll_bar_event (bar->window, part, portion, whole); 4445 x_send_scroll_bar_event (bar->window, part, portion, whole);
4463} 4446}
4464 4447
@@ -4478,7 +4461,7 @@ xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
4478 /* The position really is stored cast to a pointer. */ 4461 /* The position really is stored cast to a pointer. */
4479 int position = (intptr_t) call_data; 4462 int position = (intptr_t) call_data;
4480 Dimension height; 4463 Dimension height;
4481 int part; 4464 enum scroll_bar_part part;
4482 4465
4483 /* Get the height of the scroll bar. */ 4466 /* Get the height of the scroll bar. */
4484 block_input (); 4467 block_input ();
@@ -4497,7 +4480,7 @@ xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
4497 4480
4498 window_being_scrolled = bar->window; 4481 window_being_scrolled = bar->window;
4499 bar->dragging = -1; 4482 bar->dragging = -1;
4500 last_scroll_bar_part = part; 4483 bar->last_seen_part = part;
4501 x_send_scroll_bar_event (bar->window, part, position, height); 4484 x_send_scroll_bar_event (bar->window, part, position, height);
4502} 4485}
4503 4486
@@ -4807,16 +4790,25 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
4807 NULL); 4790 NULL);
4808 4791
4809 /* Massage the top+shown values. */ 4792 /* Massage the top+shown values. */
4810 if (bar->dragging == -1 || last_scroll_bar_part == scroll_bar_down_arrow) 4793 if (bar->dragging == -1 || bar->last_seen_part == scroll_bar_down_arrow)
4811 top = max (0, min (1, top)); 4794 top = max (0, min (1, top));
4812 else 4795 else
4813 top = old_top; 4796 top = old_top;
4797#if ! defined (HAVE_XAW3D)
4798 /* With Xaw, 'top' values too closer to 1.0 may
4799 cause the thumb to disappear. Fix that. */
4800 top = min (top, 0.99f);
4801#endif
4814 /* Keep two pixels available for moving the thumb down. */ 4802 /* Keep two pixels available for moving the thumb down. */
4815 shown = max (0, min (1 - top - (2.0f / height), shown)); 4803 shown = max (0, min (1 - top - (2.0f / height), shown));
4804#if ! defined (HAVE_XAW3D)
4805 /* Likewise with too small 'shown'. */
4806 shown = max (shown, 0.01f);
4807#endif
4816 4808
4817 /* If the call to XawScrollbarSetThumb below doesn't seem to work, 4809 /* If the call to XawScrollbarSetThumb below doesn't seem to
4818 check that your system's configuration file contains a define 4810 work, check that 'NARROWPROTO' is defined in src/config.h.
4819 for `NARROWPROTO'. See s/freebsd.h for an example. */ 4811 If this is not so, most likely you need to fix configure. */
4820 if (top != old_top || shown != old_shown) 4812 if (top != old_top || shown != old_shown)
4821 { 4813 {
4822 if (bar->dragging == -1) 4814 if (bar->dragging == -1)
@@ -4912,6 +4904,9 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
4912 bar->end = 0; 4904 bar->end = 0;
4913 bar->dragging = -1; 4905 bar->dragging = -1;
4914 bar->fringe_extended_p = 0; 4906 bar->fringe_extended_p = 0;
4907#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
4908 bar->last_seen_part = scroll_bar_nowhere;
4909#endif
4915 4910
4916 /* Add bar to its frame's list of scroll bars. */ 4911 /* Add bar to its frame's list of scroll bars. */
4917 bar->next = FRAME_SCROLL_BARS (f); 4912 bar->next = FRAME_SCROLL_BARS (f);
@@ -5980,7 +5975,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
5980 break; 5975 break;
5981 5976
5982 case SelectionNotify: 5977 case SelectionNotify:
5983 last_user_time = event.xselection.time; 5978 dpyinfo->last_user_time = event.xselection.time;
5984#ifdef USE_X_TOOLKIT 5979#ifdef USE_X_TOOLKIT
5985 if (! x_window_to_frame (dpyinfo, event.xselection.requestor)) 5980 if (! x_window_to_frame (dpyinfo, event.xselection.requestor))
5986 goto OTHER; 5981 goto OTHER;
@@ -5989,7 +5984,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
5989 break; 5984 break;
5990 5985
5991 case SelectionClear: /* Someone has grabbed ownership. */ 5986 case SelectionClear: /* Someone has grabbed ownership. */
5992 last_user_time = event.xselectionclear.time; 5987 dpyinfo->last_user_time = event.xselectionclear.time;
5993#ifdef USE_X_TOOLKIT 5988#ifdef USE_X_TOOLKIT
5994 if (! x_window_to_frame (dpyinfo, event.xselectionclear.window)) 5989 if (! x_window_to_frame (dpyinfo, event.xselectionclear.window))
5995 goto OTHER; 5990 goto OTHER;
@@ -6005,7 +6000,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6005 break; 6000 break;
6006 6001
6007 case SelectionRequest: /* Someone wants our selection. */ 6002 case SelectionRequest: /* Someone wants our selection. */
6008 last_user_time = event.xselectionrequest.time; 6003 dpyinfo->last_user_time = event.xselectionrequest.time;
6009#ifdef USE_X_TOOLKIT 6004#ifdef USE_X_TOOLKIT
6010 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) 6005 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner))
6011 goto OTHER; 6006 goto OTHER;
@@ -6024,7 +6019,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6024 break; 6019 break;
6025 6020
6026 case PropertyNotify: 6021 case PropertyNotify:
6027 last_user_time = event.xproperty.time; 6022 dpyinfo->last_user_time = event.xproperty.time;
6028 f = x_top_window_to_frame (dpyinfo, event.xproperty.window); 6023 f = x_top_window_to_frame (dpyinfo, event.xproperty.window);
6029 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) 6024 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state)
6030 if (x_handle_net_wm_state (f, &event.xproperty) 6025 if (x_handle_net_wm_state (f, &event.xproperty)
@@ -6224,7 +6219,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6224 6219
6225 case KeyPress: 6220 case KeyPress:
6226 6221
6227 last_user_time = event.xkey.time; 6222 dpyinfo->last_user_time = event.xkey.time;
6228 ignore_next_mouse_click_timeout = 0; 6223 ignore_next_mouse_click_timeout = 0;
6229 6224
6230#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 6225#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
@@ -6235,6 +6230,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6235 6230
6236 f = x_any_window_to_frame (dpyinfo, event.xkey.window); 6231 f = x_any_window_to_frame (dpyinfo, event.xkey.window);
6237 6232
6233#if ! defined (USE_GTK)
6238 /* If mouse-highlight is an integer, input clears out 6234 /* If mouse-highlight is an integer, input clears out
6239 mouse highlighting. */ 6235 mouse highlighting. */
6240 if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) 6236 if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
@@ -6244,6 +6240,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6244 clear_mouse_face (hlinfo); 6240 clear_mouse_face (hlinfo);
6245 hlinfo->mouse_face_hidden = 1; 6241 hlinfo->mouse_face_hidden = 1;
6246 } 6242 }
6243#endif
6247 6244
6248#if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS 6245#if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS
6249 if (f == 0) 6246 if (f == 0)
@@ -6553,7 +6550,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6553#endif 6550#endif
6554 6551
6555 case KeyRelease: 6552 case KeyRelease:
6556 last_user_time = event.xkey.time; 6553 dpyinfo->last_user_time = event.xkey.time;
6557#ifdef HAVE_X_I18N 6554#ifdef HAVE_X_I18N
6558 /* Don't dispatch this event since XtDispatchEvent calls 6555 /* Don't dispatch this event since XtDispatchEvent calls
6559 XFilterEvent, and two calls in a row may freeze the 6556 XFilterEvent, and two calls in a row may freeze the
@@ -6564,7 +6561,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6564#endif 6561#endif
6565 6562
6566 case EnterNotify: 6563 case EnterNotify:
6567 last_user_time = event.xcrossing.time; 6564 dpyinfo->last_user_time = event.xcrossing.time;
6568 x_detect_focus_change (dpyinfo, &event, &inev.ie); 6565 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6569 6566
6570 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); 6567 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window);
@@ -6589,7 +6586,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6589 goto OTHER; 6586 goto OTHER;
6590 6587
6591 case LeaveNotify: 6588 case LeaveNotify:
6592 last_user_time = event.xcrossing.time; 6589 dpyinfo->last_user_time = event.xcrossing.time;
6593 x_detect_focus_change (dpyinfo, &event, &inev.ie); 6590 x_detect_focus_change (dpyinfo, &event, &inev.ie);
6594 6591
6595 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); 6592 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
@@ -6623,7 +6620,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6623 6620
6624 case MotionNotify: 6621 case MotionNotify:
6625 { 6622 {
6626 last_user_time = event.xmotion.time; 6623 dpyinfo->last_user_time = event.xmotion.time;
6627 previous_help_echo_string = help_echo_string; 6624 previous_help_echo_string = help_echo_string;
6628 help_echo_string = Qnil; 6625 help_echo_string = Qnil;
6629 6626
@@ -6766,9 +6763,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6766 by the rest of Emacs, we put it here. */ 6763 by the rest of Emacs, we put it here. */
6767 bool tool_bar_p = 0; 6764 bool tool_bar_p = 0;
6768 6765
6769 memset (&compose_status, 0, sizeof (compose_status)); 6766 memset (&compose_status, 0, sizeof (compose_status));
6770 last_mouse_glyph_frame = 0; 6767 last_mouse_glyph_frame = 0;
6771 last_user_time = event.xbutton.time; 6768 dpyinfo->last_user_time = event.xbutton.time;
6772 6769
6773 if (dpyinfo->grabbed 6770 if (dpyinfo->grabbed
6774 && last_mouse_frame 6771 && last_mouse_frame
@@ -6783,6 +6780,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6783#endif 6780#endif
6784 if (f) 6781 if (f)
6785 { 6782 {
6783#if ! defined (USE_GTK)
6786 /* Is this in the tool-bar? */ 6784 /* Is this in the tool-bar? */
6787 if (WINDOWP (f->tool_bar_window) 6785 if (WINDOWP (f->tool_bar_window)
6788 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) 6786 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)))
@@ -6795,13 +6793,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6795 tool_bar_p = EQ (window, f->tool_bar_window); 6793 tool_bar_p = EQ (window, f->tool_bar_window);
6796 6794
6797 if (tool_bar_p && event.xbutton.button < 4) 6795 if (tool_bar_p && event.xbutton.button < 4)
6798 { 6796 handle_tool_bar_click
6799 handle_tool_bar_click (f, x, y, 6797 (f, x, y, event.xbutton.type == ButtonPress,
6800 event.xbutton.type == ButtonPress, 6798 x_x_to_emacs_modifiers (dpyinfo, event.xbutton.state));
6801 x_x_to_emacs_modifiers (dpyinfo,
6802 event.xbutton.state));
6803 }
6804 } 6799 }
6800#endif /* !USE_GTK */
6805 6801
6806 if (!tool_bar_p) 6802 if (!tool_bar_p)
6807#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 6803#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
@@ -7361,9 +7357,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
7361#endif 7357#endif
7362 } 7358 }
7363 7359
7364#ifndef XFlush
7365 XFlush (FRAME_X_DISPLAY (f)); 7360 XFlush (FRAME_X_DISPLAY (f));
7366#endif
7367} 7361}
7368 7362
7369 7363
@@ -8861,8 +8855,9 @@ x_ewmh_activate_frame (struct frame *f)
8861 Lisp_Object frame; 8855 Lisp_Object frame;
8862 XSETFRAME (frame, f); 8856 XSETFRAME (frame, f);
8863 x_send_client_event (frame, make_number (0), frame, 8857 x_send_client_event (frame, make_number (0), frame,
8864 dpyinfo->Xatom_net_active_window, 8858 dpyinfo->Xatom_net_active_window,
8865 make_number (32), list2i (1, last_user_time)); 8859 make_number (32),
8860 list2i (1, dpyinfo->last_user_time));
8866 } 8861 }
8867} 8862}
8868 8863
@@ -10384,11 +10379,6 @@ static struct redisplay_interface x_redisplay_interface =
10384 x_update_window_begin, 10379 x_update_window_begin,
10385 x_update_window_end, 10380 x_update_window_end,
10386 x_flush, 10381 x_flush,
10387#ifdef XFlush
10388 x_flush,
10389#else
10390 0, /* flush_display_optional */
10391#endif
10392 x_clear_window_mouse_face, 10382 x_clear_window_mouse_face,
10393 x_get_glyph_overhangs, 10383 x_get_glyph_overhangs,
10394 x_fix_overlapping_area, 10384 x_fix_overlapping_area,
diff --git a/src/xterm.h b/src/xterm.h
index 883a249629d..bdc8523009a 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -301,6 +301,9 @@ struct x_display_info
301 minibuffer. */ 301 minibuffer. */
302 struct frame *x_highlight_frame; 302 struct frame *x_highlight_frame;
303 303
304 /* Time of last user interaction as returned in X events on this display. */
305 Time last_user_time;
306
304 /* The gray pixmap. */ 307 /* The gray pixmap. */
305 Pixmap gray; 308 Pixmap gray;
306 309
@@ -801,6 +804,11 @@ struct scroll_bar
801 being dragged, this is -1. */ 804 being dragged, this is -1. */
802 int dragging; 805 int dragging;
803 806
807#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
808 /* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback. */
809 enum scroll_bar_part last_seen_part;
810#endif
811
804 /* 1 if the background of the fringe that is adjacent to a scroll 812 /* 1 if the background of the fringe that is adjacent to a scroll
805 bar is extended to the gap between the fringe and the bar. */ 813 bar is extended to the gap between the fringe and the bar. */
806 unsigned fringe_extended_p : 1; 814 unsigned fringe_extended_p : 1;