aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c445
1 files changed, 184 insertions, 261 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index e3a6eca387f..b9a16ffcc43 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -299,19 +299,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
299#include "font.h" 299#include "font.h"
300#include "fontset.h" 300#include "fontset.h"
301#include "blockinput.h" 301#include "blockinput.h"
302 302#ifdef HAVE_WINDOW_SYSTEM
303#ifdef HAVE_X_WINDOWS 303#include TERM_HEADER
304#include "xterm.h" 304#endif /* HAVE_WINDOW_SYSTEM */
305#endif
306#ifdef HAVE_NTGUI
307#include "w32term.h"
308#endif
309#ifdef HAVE_NS
310#include "nsterm.h"
311#endif
312#ifdef USE_GTK
313#include "gtkutil.h"
314#endif
315 305
316#include "font.h" 306#include "font.h"
317#ifdef HAVE_XWIDGETS 307#ifdef HAVE_XWIDGETS
@@ -526,10 +516,6 @@ int update_mode_lines;
526 516
527int windows_or_buffers_changed; 517int windows_or_buffers_changed;
528 518
529/* Nonzero means a frame's cursor type has been changed. */
530
531static int cursor_type_changed;
532
533/* Nonzero after display_mode_line if %l was used and it displayed a 519/* Nonzero after display_mode_line if %l was used and it displayed a
534 line number. */ 520 line number. */
535 521
@@ -587,12 +573,6 @@ static int last_height;
587 573
588int help_echo_showing_p; 574int help_echo_showing_p;
589 575
590/* If >= 0, computed, exact values of mode-line and header-line height
591 to use in the macros CURRENT_MODE_LINE_HEIGHT and
592 CURRENT_HEADER_LINE_HEIGHT. */
593
594int current_mode_line_height, current_header_line_height;
595
596/* The maximum distance to look ahead for text properties. Values 576/* The maximum distance to look ahead for text properties. Values
597 that are too small let us call compute_char_face and similar 577 that are too small let us call compute_char_face and similar
598 functions too often which is expensive. Values that are too large 578 functions too often which is expensive. Values that are too large
@@ -764,6 +744,8 @@ Lisp_Object previous_help_echo_string;
764 744
765/* Platform-independent portion of hourglass implementation. */ 745/* Platform-independent portion of hourglass implementation. */
766 746
747#ifdef HAVE_WINDOW_SYSTEM
748
767/* Non-zero means an hourglass cursor is currently shown. */ 749/* Non-zero means an hourglass cursor is currently shown. */
768int hourglass_shown_p; 750int hourglass_shown_p;
769 751
@@ -771,6 +753,8 @@ int hourglass_shown_p;
771 an hourglass cursor on all frames. */ 753 an hourglass cursor on all frames. */
772struct atimer *hourglass_atimer; 754struct atimer *hourglass_atimer;
773 755
756#endif /* HAVE_WINDOW_SYSTEM */
757
774/* Name of the face used to display glyphless characters. */ 758/* Name of the face used to display glyphless characters. */
775Lisp_Object Qglyphless_char; 759Lisp_Object Qglyphless_char;
776 760
@@ -780,14 +764,17 @@ static Lisp_Object Qglyphless_char_display;
780/* Method symbols for Vglyphless_char_display. */ 764/* Method symbols for Vglyphless_char_display. */
781static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width; 765static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
782 766
783/* Default pixel width of `thin-space' display method. */
784#define THIN_SPACE_WIDTH 1
785
786/* Default number of seconds to wait before displaying an hourglass 767/* Default number of seconds to wait before displaying an hourglass
787 cursor. */ 768 cursor. */
788#define DEFAULT_HOURGLASS_DELAY 1 769#define DEFAULT_HOURGLASS_DELAY 1
789 770
790 771#ifdef HAVE_WINDOW_SYSTEM
772
773/* Default pixel width of `thin-space' display method. */
774#define THIN_SPACE_WIDTH 1
775
776#endif /* HAVE_WINDOW_SYSTEM */
777
791/* Function prototypes. */ 778/* Function prototypes. */
792 779
793static void setup_for_ellipsis (struct it *, int); 780static void setup_for_ellipsis (struct it *, int);
@@ -973,12 +960,12 @@ window_text_bottom_y (struct window *w)
973 return height; 960 return height;
974} 961}
975 962
976/* Return the pixel width of display area AREA of window W. AREA < 0 963/* Return the pixel width of display area AREA of window W.
977 means return the total width of W, not including fringes to 964 ANY_AREA means return the total width of W, not including
978 the left and right of the window. */ 965 fringes to the left and right of the window. */
979 966
980int 967int
981window_box_width (struct window *w, int area) 968window_box_width (struct window *w, enum glyph_row_area area)
982{ 969{
983 int cols = w->total_cols; 970 int cols = w->total_cols;
984 int pixels = 0; 971 int pixels = 0;
@@ -1056,11 +1043,11 @@ window_box_height (struct window *w)
1056} 1043}
1057 1044
1058/* Return the window-relative coordinate of the left edge of display 1045/* Return the window-relative coordinate of the left edge of display
1059 area AREA of window W. AREA < 0 means return the left edge of the 1046 area AREA of window W. ANY_AREA means return the left edge of the
1060 whole window, to the right of the left fringe of W. */ 1047 whole window, to the right of the left fringe of W. */
1061 1048
1062int 1049int
1063window_box_left_offset (struct window *w, int area) 1050window_box_left_offset (struct window *w, enum glyph_row_area area)
1064{ 1051{
1065 int x; 1052 int x;
1066 1053
@@ -1088,21 +1075,21 @@ window_box_left_offset (struct window *w, int area)
1088 1075
1089 1076
1090/* Return the window-relative coordinate of the right edge of display 1077/* Return the window-relative coordinate of the right edge of display
1091 area AREA of window W. AREA < 0 means return the right edge of the 1078 area AREA of window W. ANY_AREA means return the right edge of the
1092 whole window, to the left of the right fringe of W. */ 1079 whole window, to the left of the right fringe of W. */
1093 1080
1094int 1081int
1095window_box_right_offset (struct window *w, int area) 1082window_box_right_offset (struct window *w, enum glyph_row_area area)
1096{ 1083{
1097 return window_box_left_offset (w, area) + window_box_width (w, area); 1084 return window_box_left_offset (w, area) + window_box_width (w, area);
1098} 1085}
1099 1086
1100/* Return the frame-relative coordinate of the left edge of display 1087/* Return the frame-relative coordinate of the left edge of display
1101 area AREA of window W. AREA < 0 means return the left edge of the 1088 area AREA of window W. ANY_AREA means return the left edge of the
1102 whole window, to the right of the left fringe of W. */ 1089 whole window, to the right of the left fringe of W. */
1103 1090
1104int 1091int
1105window_box_left (struct window *w, int area) 1092window_box_left (struct window *w, enum glyph_row_area area)
1106{ 1093{
1107 struct frame *f = XFRAME (w->frame); 1094 struct frame *f = XFRAME (w->frame);
1108 int x; 1095 int x;
@@ -1118,25 +1105,25 @@ window_box_left (struct window *w, int area)
1118 1105
1119 1106
1120/* Return the frame-relative coordinate of the right edge of display 1107/* Return the frame-relative coordinate of the right edge of display
1121 area AREA of window W. AREA < 0 means return the right edge of the 1108 area AREA of window W. ANY_AREA means return the right edge of the
1122 whole window, to the left of the right fringe of W. */ 1109 whole window, to the left of the right fringe of W. */
1123 1110
1124int 1111int
1125window_box_right (struct window *w, int area) 1112window_box_right (struct window *w, enum glyph_row_area area)
1126{ 1113{
1127 return window_box_left (w, area) + window_box_width (w, area); 1114 return window_box_left (w, area) + window_box_width (w, area);
1128} 1115}
1129 1116
1130/* Get the bounding box of the display area AREA of window W, without 1117/* Get the bounding box of the display area AREA of window W, without
1131 mode lines, in frame-relative coordinates. AREA < 0 means the 1118 mode lines, in frame-relative coordinates. ANY_AREA means the
1132 whole window, not including the left and right fringes of 1119 whole window, not including the left and right fringes of
1133 the window. Return in *BOX_X and *BOX_Y the frame-relative pixel 1120 the window. Return in *BOX_X and *BOX_Y the frame-relative pixel
1134 coordinates of the upper-left corner of the box. Return in 1121 coordinates of the upper-left corner of the box. Return in
1135 *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ 1122 *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */
1136 1123
1137void 1124void
1138window_box (struct window *w, int area, int *box_x, int *box_y, 1125window_box (struct window *w, enum glyph_row_area area, int *box_x,
1139 int *box_width, int *box_height) 1126 int *box_y, int *box_width, int *box_height)
1140{ 1127{
1141 if (box_width) 1128 if (box_width)
1142 *box_width = window_box_width (w, area); 1129 *box_width = window_box_width (w, area);
@@ -1152,27 +1139,27 @@ window_box (struct window *w, int area, int *box_x, int *box_y,
1152 } 1139 }
1153} 1140}
1154 1141
1142#ifdef HAVE_WINDOW_SYSTEM
1155 1143
1156/* Get the bounding box of the display area AREA of window W, without 1144/* Get the bounding box of the display area AREA of window W, without
1157 mode lines. AREA < 0 means the whole window, not including the 1145 mode lines and both fringes of the window. Return in *TOP_LEFT_X
1158 left and right fringe of the window. Return in *TOP_LEFT_X
1159 and TOP_LEFT_Y the frame-relative pixel coordinates of the 1146 and TOP_LEFT_Y the frame-relative pixel coordinates of the
1160 upper-left corner of the box. Return in *BOTTOM_RIGHT_X, and 1147 upper-left corner of the box. Return in *BOTTOM_RIGHT_X, and
1161 *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the 1148 *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the
1162 box. */ 1149 box. */
1163 1150
1164static void 1151static void
1165window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y, 1152window_box_edges (struct window *w, int *top_left_x, int *top_left_y,
1166 int *bottom_right_x, int *bottom_right_y) 1153 int *bottom_right_x, int *bottom_right_y)
1167{ 1154{
1168 window_box (w, area, top_left_x, top_left_y, bottom_right_x, 1155 window_box (w, ANY_AREA, top_left_x, top_left_y,
1169 bottom_right_y); 1156 bottom_right_x, bottom_right_y);
1170 *bottom_right_x += *top_left_x; 1157 *bottom_right_x += *top_left_x;
1171 *bottom_right_y += *top_left_y; 1158 *bottom_right_y += *top_left_y;
1172} 1159}
1173 1160
1161#endif /* HAVE_WINDOW_SYSTEM */
1174 1162
1175
1176/*********************************************************************** 1163/***********************************************************************
1177 Utilities 1164 Utilities
1178 ***********************************************************************/ 1165 ***********************************************************************/
@@ -1359,12 +1346,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1359 1346
1360 /* Compute exact mode line heights. */ 1347 /* Compute exact mode line heights. */
1361 if (WINDOW_WANTS_MODELINE_P (w)) 1348 if (WINDOW_WANTS_MODELINE_P (w))
1362 current_mode_line_height 1349 w->mode_line_height
1363 = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), 1350 = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
1364 BVAR (current_buffer, mode_line_format)); 1351 BVAR (current_buffer, mode_line_format));
1365 1352
1366 if (WINDOW_WANTS_HEADER_LINE_P (w)) 1353 if (WINDOW_WANTS_HEADER_LINE_P (w))
1367 current_header_line_height 1354 w->header_line_height
1368 = display_mode_line (w, HEADER_LINE_FACE_ID, 1355 = display_mode_line (w, HEADER_LINE_FACE_ID,
1369 BVAR (current_buffer, header_line_format)); 1356 BVAR (current_buffer, header_line_format));
1370 1357
@@ -1657,8 +1644,6 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1657 if (old_buffer) 1644 if (old_buffer)
1658 set_buffer_internal_1 (old_buffer); 1645 set_buffer_internal_1 (old_buffer);
1659 1646
1660 current_header_line_height = current_mode_line_height = -1;
1661
1662 if (visible_p && w->hscroll > 0) 1647 if (visible_p && w->hscroll > 0)
1663 *x -= 1648 *x -=
1664 window_hscroll_limited (w, WINDOW_XFRAME (w)) 1649 window_hscroll_limited (w, WINDOW_XFRAME (w))
@@ -6721,17 +6706,59 @@ lookup_glyphless_char_display (int c, struct it *it)
6721 return glyphless_method; 6706 return glyphless_method;
6722} 6707}
6723 6708
6724/* Load IT's display element fields with information about the next 6709/* Merge escape glyph face and cache the result. */
6725 display element from the current position of IT. Value is zero if
6726 end of buffer (or C string) is reached. */
6727 6710
6728static struct frame *last_escape_glyph_frame = NULL; 6711static struct frame *last_escape_glyph_frame = NULL;
6729static int last_escape_glyph_face_id = (1 << FACE_ID_BITS); 6712static int last_escape_glyph_face_id = (1 << FACE_ID_BITS);
6730static int last_escape_glyph_merged_face_id = 0; 6713static int last_escape_glyph_merged_face_id = 0;
6731 6714
6732struct frame *last_glyphless_glyph_frame = NULL; 6715static int
6733int last_glyphless_glyph_face_id = (1 << FACE_ID_BITS); 6716merge_escape_glyph_face (struct it *it)
6734int last_glyphless_glyph_merged_face_id = 0; 6717{
6718 int face_id;
6719
6720 if (it->f == last_escape_glyph_frame
6721 && it->face_id == last_escape_glyph_face_id)
6722 face_id = last_escape_glyph_merged_face_id;
6723 else
6724 {
6725 /* Merge the `escape-glyph' face into the current face. */
6726 face_id = merge_faces (it->f, Qescape_glyph, 0, it->face_id);
6727 last_escape_glyph_frame = it->f;
6728 last_escape_glyph_face_id = it->face_id;
6729 last_escape_glyph_merged_face_id = face_id;
6730 }
6731 return face_id;
6732}
6733
6734/* Likewise for glyphless glyph face. */
6735
6736static struct frame *last_glyphless_glyph_frame = NULL;
6737static int last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
6738static int last_glyphless_glyph_merged_face_id = 0;
6739
6740int
6741merge_glyphless_glyph_face (struct it *it)
6742{
6743 int face_id;
6744
6745 if (it->f == last_glyphless_glyph_frame
6746 && it->face_id == last_glyphless_glyph_face_id)
6747 face_id = last_glyphless_glyph_merged_face_id;
6748 else
6749 {
6750 /* Merge the `glyphless-char' face into the current face. */
6751 face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
6752 last_glyphless_glyph_frame = it->f;
6753 last_glyphless_glyph_face_id = it->face_id;
6754 last_glyphless_glyph_merged_face_id = face_id;
6755 }
6756 return face_id;
6757}
6758
6759/* Load IT's display element fields with information about the next
6760 display element from the current position of IT. Value is zero if
6761 end of buffer (or C string) is reached. */
6735 6762
6736static int 6763static int
6737get_next_display_element (struct it *it) 6764get_next_display_element (struct it *it)
@@ -6879,24 +6906,10 @@ get_next_display_element (struct it *it)
6879 g = GLYPH_CODE_CHAR (gc); 6906 g = GLYPH_CODE_CHAR (gc);
6880 lface_id = GLYPH_CODE_FACE (gc); 6907 lface_id = GLYPH_CODE_FACE (gc);
6881 } 6908 }
6882 if (lface_id) 6909
6883 { 6910 face_id = (lface_id
6884 face_id = merge_faces (it->f, Qt, lface_id, it->face_id); 6911 ? merge_faces (it->f, Qt, lface_id, it->face_id)
6885 } 6912 : merge_escape_glyph_face (it));
6886 else if (it->f == last_escape_glyph_frame
6887 && it->face_id == last_escape_glyph_face_id)
6888 {
6889 face_id = last_escape_glyph_merged_face_id;
6890 }
6891 else
6892 {
6893 /* Merge the escape-glyph face into the current face. */
6894 face_id = merge_faces (it->f, Qescape_glyph, 0,
6895 it->face_id);
6896 last_escape_glyph_frame = it->f;
6897 last_escape_glyph_face_id = it->face_id;
6898 last_escape_glyph_merged_face_id = face_id;
6899 }
6900 6913
6901 XSETINT (it->ctl_chars[0], g); 6914 XSETINT (it->ctl_chars[0], g);
6902 XSETINT (it->ctl_chars[1], c ^ 0100); 6915 XSETINT (it->ctl_chars[1], c ^ 0100);
@@ -6928,27 +6941,10 @@ get_next_display_element (struct it *it)
6928 escape_glyph = GLYPH_CODE_CHAR (gc); 6941 escape_glyph = GLYPH_CODE_CHAR (gc);
6929 lface_id = GLYPH_CODE_FACE (gc); 6942 lface_id = GLYPH_CODE_FACE (gc);
6930 } 6943 }
6931 if (lface_id) 6944
6932 { 6945 face_id = (lface_id
6933 /* The display table specified a face. 6946 ? merge_faces (it->f, Qt, lface_id, it->face_id)
6934 Merge it into face_id and also into escape_glyph. */ 6947 : merge_escape_glyph_face (it));
6935 face_id = merge_faces (it->f, Qt, lface_id,
6936 it->face_id);
6937 }
6938 else if (it->f == last_escape_glyph_frame
6939 && it->face_id == last_escape_glyph_face_id)
6940 {
6941 face_id = last_escape_glyph_merged_face_id;
6942 }
6943 else
6944 {
6945 /* Merge the escape-glyph face into the current face. */
6946 face_id = merge_faces (it->f, Qescape_glyph, 0,
6947 it->face_id);
6948 last_escape_glyph_frame = it->f;
6949 last_escape_glyph_face_id = it->face_id;
6950 last_escape_glyph_merged_face_id = face_id;
6951 }
6952 6948
6953 /* Draw non-ASCII hyphen with just highlighting: */ 6949 /* Draw non-ASCII hyphen with just highlighting: */
6954 6950
@@ -10827,11 +10823,9 @@ clear_garbaged_frames (void)
10827 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f)) 10823 if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
10828 { 10824 {
10829 if (f->resized_p) 10825 if (f->resized_p)
10830 { 10826 redraw_frame (f);
10831 redraw_frame (f); 10827 else
10832 f->force_flush_display_p = 1; 10828 clear_current_matrices (f);
10833 }
10834 clear_current_matrices (f);
10835 changed_count++; 10829 changed_count++;
10836 f->garbaged = 0; 10830 f->garbaged = 0;
10837 f->resized_p = 0; 10831 f->resized_p = 0;
@@ -10919,7 +10913,7 @@ echo_area_display (int update_frame_p)
10919 Can do with a display update of the echo area, 10913 Can do with a display update of the echo area,
10920 unless we displayed some mode lines. */ 10914 unless we displayed some mode lines. */
10921 update_single_window (w, 1); 10915 update_single_window (w, 1);
10922 FRAME_RIF (f)->flush_display (f); 10916 flush_frame (f);
10923 } 10917 }
10924 else 10918 else
10925 update_frame (f, 1, 1); 10919 update_frame (f, 1, 1);
@@ -11501,62 +11495,6 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
11501 return hooks_run; 11495 return hooks_run;
11502} 11496}
11503 11497
11504
11505
11506/***********************************************************************
11507 Output Cursor
11508 ***********************************************************************/
11509
11510#ifdef HAVE_WINDOW_SYSTEM
11511
11512/* EXPORT:
11513 Nominal cursor position -- where to draw output.
11514 HPOS and VPOS are window relative glyph matrix coordinates.
11515 X and Y are window relative pixel coordinates. */
11516
11517struct cursor_pos output_cursor;
11518
11519
11520/* EXPORT:
11521 Set the global variable output_cursor to CURSOR. All cursor
11522 positions are relative to currently updated window. */
11523
11524void
11525set_output_cursor (struct cursor_pos *cursor)
11526{
11527 output_cursor.hpos = cursor->hpos;
11528 output_cursor.vpos = cursor->vpos;
11529 output_cursor.x = cursor->x;
11530 output_cursor.y = cursor->y;
11531}
11532
11533
11534/* EXPORT for RIF:
11535 Set a nominal cursor position.
11536
11537 HPOS and VPOS are column/row positions in a window glyph matrix.
11538 X and Y are window text area relative pixel positions.
11539
11540 This is always done during window update, so the position is the
11541 future output cursor position for currently updated window W.
11542 NOTE: W is used only to check whether this function is called
11543 in a consistent manner via the redisplay interface. */
11544
11545void
11546x_cursor_to (struct window *w, int vpos, int hpos, int y, int x)
11547{
11548 eassert (w);
11549
11550 /* Set the output cursor. */
11551 output_cursor.hpos = hpos;
11552 output_cursor.vpos = vpos;
11553 output_cursor.x = x;
11554 output_cursor.y = y;
11555}
11556
11557#endif /* HAVE_WINDOW_SYSTEM */
11558
11559
11560/*********************************************************************** 11498/***********************************************************************
11561 Tool-bars 11499 Tool-bars
11562 ***********************************************************************/ 11500 ***********************************************************************/
@@ -12108,7 +12046,7 @@ redisplay_tool_bar (struct frame *f)
12108 if (WINDOW_TOTAL_LINES (w) != old_height) 12046 if (WINDOW_TOTAL_LINES (w) != old_height)
12109 { 12047 {
12110 clear_glyph_matrix (w->desired_matrix); 12048 clear_glyph_matrix (w->desired_matrix);
12111 fonts_changed_p = 1; 12049 f->fonts_changed = 1;
12112 return 1; 12050 return 1;
12113 } 12051 }
12114 } 12052 }
@@ -12209,7 +12147,7 @@ redisplay_tool_bar (struct frame *f)
12209 { 12147 {
12210 clear_glyph_matrix (w->desired_matrix); 12148 clear_glyph_matrix (w->desired_matrix);
12211 f->n_tool_bar_rows = nrows; 12149 f->n_tool_bar_rows = nrows;
12212 fonts_changed_p = 1; 12150 f->fonts_changed = 1;
12213 return 1; 12151 return 1;
12214 } 12152 }
12215 } 12153 }
@@ -13095,15 +13033,6 @@ redisplay_internal (void)
13095 last_glyphless_glyph_frame = NULL; 13033 last_glyphless_glyph_frame = NULL;
13096 last_glyphless_glyph_face_id = (1 << FACE_ID_BITS); 13034 last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
13097 13035
13098 /* If new fonts have been loaded that make a glyph matrix adjustment
13099 necessary, do it. */
13100 if (fonts_changed_p)
13101 {
13102 adjust_glyphs (NULL);
13103 ++windows_or_buffers_changed;
13104 fonts_changed_p = 0;
13105 }
13106
13107 /* If face_change_count is non-zero, init_iterator will free all 13036 /* If face_change_count is non-zero, init_iterator will free all
13108 realized faces, which includes the faces referenced from current 13037 realized faces, which includes the faces referenced from current
13109 matrices. So, we can't reuse current matrices in this case. */ 13038 matrices. So, we can't reuse current matrices in this case. */
@@ -13134,7 +13063,19 @@ redisplay_internal (void)
13134 struct frame *f = XFRAME (frame); 13063 struct frame *f = XFRAME (frame);
13135 13064
13136 if (FRAME_VISIBLE_P (f)) 13065 if (FRAME_VISIBLE_P (f))
13137 ++number_of_visible_frames; 13066 {
13067 ++number_of_visible_frames;
13068 /* Adjust matrices for visible frames only. */
13069 if (f->fonts_changed)
13070 {
13071 adjust_frame_glyphs (f);
13072 f->fonts_changed = 0;
13073 }
13074 /* If cursor type has been changed on the frame
13075 other than selected, consider all frames. */
13076 if (f != sf && f->cursor_type_changed)
13077 update_mode_lines++;
13078 }
13138 clear_desired_matrices (f); 13079 clear_desired_matrices (f);
13139 } 13080 }
13140 13081
@@ -13183,8 +13124,7 @@ redisplay_internal (void)
13183 } 13124 }
13184 13125
13185 consider_all_windows_p = (update_mode_lines 13126 consider_all_windows_p = (update_mode_lines
13186 || buffer_shared_and_changed () 13127 || buffer_shared_and_changed ());
13187 || cursor_type_changed);
13188 13128
13189 /* If specs for an arrow have changed, do thorough redisplay 13129 /* If specs for an arrow have changed, do thorough redisplay
13190 to ensure we remove any arrow that should no longer exist. */ 13130 to ensure we remove any arrow that should no longer exist. */
@@ -13218,9 +13158,7 @@ redisplay_internal (void)
13218 if (!display_last_displayed_message_p) 13158 if (!display_last_displayed_message_p)
13219 message_cleared_p = 0; 13159 message_cleared_p = 0;
13220 13160
13221 if (fonts_changed_p) 13161 if (window_height_changed_p)
13222 goto retry;
13223 else if (window_height_changed_p)
13224 { 13162 {
13225 consider_all_windows_p = 1; 13163 consider_all_windows_p = 1;
13226 ++update_mode_lines; 13164 ++update_mode_lines;
@@ -13277,6 +13215,7 @@ redisplay_internal (void)
13277 && !current_buffer->prevent_redisplay_optimizations_p 13215 && !current_buffer->prevent_redisplay_optimizations_p
13278 && FRAME_VISIBLE_P (XFRAME (w->frame)) 13216 && FRAME_VISIBLE_P (XFRAME (w->frame))
13279 && !FRAME_OBSCURED_P (XFRAME (w->frame)) 13217 && !FRAME_OBSCURED_P (XFRAME (w->frame))
13218 && !XFRAME (w->frame)->cursor_type_changed
13280 /* Make sure recorded data applies to current buffer, etc. */ 13219 /* Make sure recorded data applies to current buffer, etc. */
13281 && this_line_buffer == current_buffer 13220 && this_line_buffer == current_buffer
13282 && match_p 13221 && match_p
@@ -13502,6 +13441,8 @@ redisplay_internal (void)
13502 && !EQ (FRAME_TTY (f)->top_frame, frame)) 13441 && !EQ (FRAME_TTY (f)->top_frame, frame))
13503 continue; 13442 continue;
13504 13443
13444 retry_frame:
13445
13505 if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf) 13446 if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
13506 { 13447 {
13507 /* Mark all the scroll bars to be removed; we'll redeem 13448 /* Mark all the scroll bars to be removed; we'll redeem
@@ -13521,20 +13462,22 @@ redisplay_internal (void)
13521 if (FRAME_TERMINAL (f)->judge_scroll_bars_hook) 13462 if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
13522 FRAME_TERMINAL (f)->judge_scroll_bars_hook (f); 13463 FRAME_TERMINAL (f)->judge_scroll_bars_hook (f);
13523 13464
13524 /* If fonts changed, display again. */
13525 /* ??? rms: I suspect it is a mistake to jump all the way
13526 back to retry here. It should just retry this frame. */
13527 if (fonts_changed_p)
13528 goto retry;
13529
13530 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) 13465 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
13531 { 13466 {
13467 /* If fonts changed on visible frame, display again. */
13468 if (f->fonts_changed)
13469 {
13470 adjust_frame_glyphs (f);
13471 f->fonts_changed = 0;
13472 goto retry_frame;
13473 }
13474
13532 /* See if we have to hscroll. */ 13475 /* See if we have to hscroll. */
13533 if (!f->already_hscrolled_p) 13476 if (!f->already_hscrolled_p)
13534 { 13477 {
13535 f->already_hscrolled_p = 1; 13478 f->already_hscrolled_p = 1;
13536 if (hscroll_windows (f->root_window)) 13479 if (hscroll_windows (f->root_window))
13537 goto retry; 13480 goto retry_frame;
13538 } 13481 }
13539 13482
13540 /* Prevent various kinds of signals during display 13483 /* Prevent various kinds of signals during display
@@ -13548,6 +13491,7 @@ redisplay_internal (void)
13548 /* Update the display. */ 13491 /* Update the display. */
13549 set_window_update_flags (XWINDOW (f->root_window), 1); 13492 set_window_update_flags (XWINDOW (f->root_window), 1);
13550 pending |= update_frame (f, 0, 0); 13493 pending |= update_frame (f, 0, 0);
13494 f->cursor_type_changed = 0;
13551 f->updated_p = 1; 13495 f->updated_p = 1;
13552 } 13496 }
13553 } 13497 }
@@ -13592,7 +13536,7 @@ redisplay_internal (void)
13592 13536
13593 update: 13537 update:
13594 /* If fonts changed, display again. */ 13538 /* If fonts changed, display again. */
13595 if (fonts_changed_p) 13539 if (sf->fonts_changed)
13596 goto retry; 13540 goto retry;
13597 13541
13598 /* Prevent various kinds of signals during display update. 13542 /* Prevent various kinds of signals during display update.
@@ -13609,6 +13553,7 @@ redisplay_internal (void)
13609 13553
13610 XWINDOW (selected_window)->must_be_updated_p = 1; 13554 XWINDOW (selected_window)->must_be_updated_p = 1;
13611 pending = update_frame (sf, 0, 0); 13555 pending = update_frame (sf, 0, 0);
13556 sf->cursor_type_changed = 0;
13612 } 13557 }
13613 13558
13614 /* We may have called echo_area_display at the top of this 13559 /* We may have called echo_area_display at the top of this
@@ -13623,6 +13568,7 @@ redisplay_internal (void)
13623 { 13568 {
13624 XWINDOW (mini_window)->must_be_updated_p = 1; 13569 XWINDOW (mini_window)->must_be_updated_p = 1;
13625 pending |= update_frame (mini_frame, 0, 0); 13570 pending |= update_frame (mini_frame, 0, 0);
13571 mini_frame->cursor_type_changed = 0;
13626 if (!pending && hscroll_windows (mini_window)) 13572 if (!pending && hscroll_windows (mini_window))
13627 goto retry; 13573 goto retry;
13628 } 13574 }
@@ -13663,7 +13609,6 @@ redisplay_internal (void)
13663 13609
13664 update_mode_lines = 0; 13610 update_mode_lines = 0;
13665 windows_or_buffers_changed = 0; 13611 windows_or_buffers_changed = 0;
13666 cursor_type_changed = 0;
13667 } 13612 }
13668 13613
13669 /* Start SIGIO interrupts coming again. Having them off during the 13614 /* Start SIGIO interrupts coming again. Having them off during the
@@ -13761,9 +13706,7 @@ redisplay_preserve_echo_area (int from_where)
13761 else 13706 else
13762 redisplay_internal (); 13707 redisplay_internal ();
13763 13708
13764 if (FRAME_RIF (SELECTED_FRAME ()) != NULL 13709 flush_frame (SELECTED_FRAME ());
13765 && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
13766 FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
13767} 13710}
13768 13711
13769 13712
@@ -15105,7 +15048,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15105 cases. */ 15048 cases. */
15106 && !update_mode_lines 15049 && !update_mode_lines
15107 && !windows_or_buffers_changed 15050 && !windows_or_buffers_changed
15108 && !cursor_type_changed 15051 && !f->cursor_type_changed
15109 /* Can't use this case if highlighting a region. When a 15052 /* Can't use this case if highlighting a region. When a
15110 region exists, cursor movement has to do more than just 15053 region exists, cursor movement has to do more than just
15111 set the cursor. */ 15054 set the cursor. */
@@ -15452,9 +15395,8 @@ set_vertical_scroll_bar (struct window *w)
15452/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only 15395/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only
15453 selected_window is redisplayed. 15396 selected_window is redisplayed.
15454 15397
15455 We can return without actually redisplaying the window if 15398 We can return without actually redisplaying the window if fonts has been
15456 fonts_changed_p. In that case, redisplay_internal will 15399 changed on window's frame. In that case, redisplay_internal will retry. */
15457 retry. */
15458 15400
15459static void 15401static void
15460redisplay_window (Lisp_Object window, int just_this_one_p) 15402redisplay_window (Lisp_Object window, int just_this_one_p)
@@ -15839,7 +15781,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15839 debug_method_add (w, "try_window_id %d", tem); 15781 debug_method_add (w, "try_window_id %d", tem);
15840#endif 15782#endif
15841 15783
15842 if (fonts_changed_p) 15784 if (f->fonts_changed)
15843 goto need_larger_matrices; 15785 goto need_larger_matrices;
15844 if (tem > 0) 15786 if (tem > 0)
15845 goto done; 15787 goto done;
@@ -15909,12 +15851,12 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15909 IF_DEBUG (debug_method_add (w, "1")); 15851 IF_DEBUG (debug_method_add (w, "1"));
15910 if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0) 15852 if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
15911 /* -1 means we need to scroll. 15853 /* -1 means we need to scroll.
15912 0 means we need new matrices, but fonts_changed_p 15854 0 means we need new matrices, but fonts_changed
15913 is set in that case, so we will detect it below. */ 15855 is set in that case, so we will detect it below. */
15914 goto try_to_scroll; 15856 goto try_to_scroll;
15915 } 15857 }
15916 15858
15917 if (fonts_changed_p) 15859 if (f->fonts_changed)
15918 goto need_larger_matrices; 15860 goto need_larger_matrices;
15919 15861
15920 if (w->cursor.vpos >= 0) 15862 if (w->cursor.vpos >= 0)
@@ -16102,7 +16044,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16102 /* Redisplay the window. */ 16044 /* Redisplay the window. */
16103 if (!current_matrix_up_to_date_p 16045 if (!current_matrix_up_to_date_p
16104 || windows_or_buffers_changed 16046 || windows_or_buffers_changed
16105 || cursor_type_changed 16047 || f->cursor_type_changed
16106 /* Don't use try_window_reusing_current_matrix in this case 16048 /* Don't use try_window_reusing_current_matrix in this case
16107 because it can have changed the buffer. */ 16049 because it can have changed the buffer. */
16108 || !NILP (Vwindow_scroll_functions) 16050 || !NILP (Vwindow_scroll_functions)
@@ -16115,7 +16057,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16115 /* If new fonts have been loaded (due to fontsets), give up. We 16057 /* If new fonts have been loaded (due to fontsets), give up. We
16116 have to start a new redisplay since we need to re-adjust glyph 16058 have to start a new redisplay since we need to re-adjust glyph
16117 matrices. */ 16059 matrices. */
16118 if (fonts_changed_p) 16060 if (f->fonts_changed)
16119 goto need_larger_matrices; 16061 goto need_larger_matrices;
16120 16062
16121 /* If cursor did not appear assume that the middle of the window is 16063 /* If cursor did not appear assume that the middle of the window is
@@ -16228,7 +16170,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16228 if (WINDOW_WANTS_MODELINE_P (w) 16170 if (WINDOW_WANTS_MODELINE_P (w)
16229 && CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w)) 16171 && CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w))
16230 { 16172 {
16231 fonts_changed_p = 1; 16173 f->fonts_changed = 1;
16174 w->mode_line_height = -1;
16232 MATRIX_MODE_LINE_ROW (w->current_matrix)->height 16175 MATRIX_MODE_LINE_ROW (w->current_matrix)->height
16233 = DESIRED_MODE_LINE_HEIGHT (w); 16176 = DESIRED_MODE_LINE_HEIGHT (w);
16234 } 16177 }
@@ -16238,12 +16181,13 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16238 if (WINDOW_WANTS_HEADER_LINE_P (w) 16181 if (WINDOW_WANTS_HEADER_LINE_P (w)
16239 && CURRENT_HEADER_LINE_HEIGHT (w) != DESIRED_HEADER_LINE_HEIGHT (w)) 16182 && CURRENT_HEADER_LINE_HEIGHT (w) != DESIRED_HEADER_LINE_HEIGHT (w))
16240 { 16183 {
16241 fonts_changed_p = 1; 16184 f->fonts_changed = 1;
16185 w->header_line_height = -1;
16242 MATRIX_HEADER_LINE_ROW (w->current_matrix)->height 16186 MATRIX_HEADER_LINE_ROW (w->current_matrix)->height
16243 = DESIRED_HEADER_LINE_HEIGHT (w); 16187 = DESIRED_HEADER_LINE_HEIGHT (w);
16244 } 16188 }
16245 16189
16246 if (fonts_changed_p) 16190 if (f->fonts_changed)
16247 goto need_larger_matrices; 16191 goto need_larger_matrices;
16248 } 16192 }
16249 16193
@@ -16308,8 +16252,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16308 } 16252 }
16309#endif /* HAVE_WINDOW_SYSTEM */ 16253#endif /* HAVE_WINDOW_SYSTEM */
16310 16254
16311 /* We go to this label, with fonts_changed_p set, 16255 /* We go to this label, with fonts_changed set, if it is
16312 if it is necessary to try again using larger glyph matrices. 16256 necessary to try again using larger glyph matrices.
16313 We have to redeem the scroll bar even in this case, 16257 We have to redeem the scroll bar even in this case,
16314 because the loop in redisplay_internal expects that. */ 16258 because the loop in redisplay_internal expects that. */
16315 need_larger_matrices: 16259 need_larger_matrices:
@@ -16383,7 +16327,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16383 { 16327 {
16384 if (display_line (&it)) 16328 if (display_line (&it))
16385 last_text_row = it.glyph_row - 1; 16329 last_text_row = it.glyph_row - 1;
16386 if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE)) 16330 if (f->fonts_changed && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
16387 return 0; 16331 return 0;
16388 } 16332 }
16389#ifdef HAVE_XWIDGETS_xxx 16333#ifdef HAVE_XWIDGETS_xxx
@@ -16493,7 +16437,7 @@ try_window_reusing_current_matrix (struct window *w)
16493 /* Don't try to reuse the display if windows have been split 16437 /* Don't try to reuse the display if windows have been split
16494 or such. */ 16438 or such. */
16495 || windows_or_buffers_changed 16439 || windows_or_buffers_changed
16496 || cursor_type_changed) 16440 || f->cursor_type_changed)
16497 return 0; 16441 return 0;
16498 16442
16499 /* Can't do this if region may have changed. */ 16443 /* Can't do this if region may have changed. */
@@ -16541,8 +16485,7 @@ try_window_reusing_current_matrix (struct window *w)
16541 w->cursor.vpos = -1; 16485 w->cursor.vpos = -1;
16542 last_text_row = last_reused_text_row = NULL; 16486 last_text_row = last_reused_text_row = NULL;
16543 16487
16544 while (it.current_y < it.last_visible_y 16488 while (it.current_y < it.last_visible_y && !f->fonts_changed)
16545 && !fonts_changed_p)
16546 { 16489 {
16547 /* If we have reached into the characters in the START row, 16490 /* If we have reached into the characters in the START row,
16548 that means the line boundaries have changed. So we 16491 that means the line boundaries have changed. So we
@@ -16753,7 +16696,7 @@ try_window_reusing_current_matrix (struct window *w)
16753 if (pt_row == NULL) 16696 if (pt_row == NULL)
16754 w->cursor.vpos = -1; 16697 w->cursor.vpos = -1;
16755 last_text_row = NULL; 16698 last_text_row = NULL;
16756 while (it.current_y < it.last_visible_y && !fonts_changed_p) 16699 while (it.current_y < it.last_visible_y && !f->fonts_changed)
16757 if (display_line (&it)) 16700 if (display_line (&it))
16758 last_text_row = it.glyph_row - 1; 16701 last_text_row = it.glyph_row - 1;
16759 16702
@@ -17272,7 +17215,7 @@ try_window_id (struct window *w)
17272 GIVE_UP (1); 17215 GIVE_UP (1);
17273 17216
17274 /* This flag is used to prevent redisplay optimizations. */ 17217 /* This flag is used to prevent redisplay optimizations. */
17275 if (windows_or_buffers_changed || cursor_type_changed) 17218 if (windows_or_buffers_changed || f->cursor_type_changed)
17276 GIVE_UP (2); 17219 GIVE_UP (2);
17277 17220
17278 /* Verify that narrowing has not changed. 17221 /* Verify that narrowing has not changed.
@@ -17603,7 +17546,7 @@ try_window_id (struct window *w)
17603 last_text_row = NULL; 17546 last_text_row = NULL;
17604 overlay_arrow_seen = 0; 17547 overlay_arrow_seen = 0;
17605 while (it.current_y < it.last_visible_y 17548 while (it.current_y < it.last_visible_y
17606 && !fonts_changed_p 17549 && !f->fonts_changed
17607 && (first_unchanged_at_end_row == NULL 17550 && (first_unchanged_at_end_row == NULL
17608 || IT_CHARPOS (it) < stop_pos)) 17551 || IT_CHARPOS (it) < stop_pos))
17609 { 17552 {
@@ -17611,7 +17554,7 @@ try_window_id (struct window *w)
17611 last_text_row = it.glyph_row - 1; 17554 last_text_row = it.glyph_row - 1;
17612 } 17555 }
17613 17556
17614 if (fonts_changed_p) 17557 if (f->fonts_changed)
17615 return -1; 17558 return -1;
17616 17559
17617 17560
@@ -17858,8 +17801,7 @@ try_window_id (struct window *w)
17858 17801
17859 /* Display the rest of the lines at the window end. */ 17802 /* Display the rest of the lines at the window end. */
17860 it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos); 17803 it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos);
17861 while (it.current_y < it.last_visible_y 17804 while (it.current_y < it.last_visible_y && !f->fonts_changed)
17862 && !fonts_changed_p)
17863 { 17805 {
17864 /* Is it always sure that the display agrees with lines in 17806 /* Is it always sure that the display agrees with lines in
17865 the current matrix? I don't think so, so we mark rows 17807 the current matrix? I don't think so, so we mark rows
@@ -19418,7 +19360,7 @@ display_line (struct it *it)
19418 >= it->w->desired_matrix->nrows) 19360 >= it->w->desired_matrix->nrows)
19419 { 19361 {
19420 it->w->nrows_scale_factor++; 19362 it->w->nrows_scale_factor++;
19421 fonts_changed_p = 1; 19363 it->f->fonts_changed = 1;
19422 return 0; 19364 return 0;
19423 } 19365 }
19424 19366
@@ -20770,13 +20712,8 @@ redisplay_mode_lines (Lisp_Object window, int force)
20770 { 20712 {
20771 struct text_pos pt; 20713 struct text_pos pt;
20772 20714
20773 SET_TEXT_POS_FROM_MARKER (pt, w->pointm); 20715 CLIP_TEXT_POS_FROM_MARKER (pt, w->pointm);
20774 if (CHARPOS (pt) < BEGV) 20716 TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt));
20775 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
20776 else if (CHARPOS (pt) > (ZV - 1))
20777 TEMP_SET_PT_BOTH (ZV, ZV_BYTE);
20778 else
20779 TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt));
20780 } 20717 }
20781 20718
20782 /* Display mode lines. */ 20719 /* Display mode lines. */
@@ -24205,12 +24142,12 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
24205 24142
24206#define IT_EXPAND_MATRIX_WIDTH(it, area) \ 24143#define IT_EXPAND_MATRIX_WIDTH(it, area) \
24207 { \ 24144 { \
24208 if (!fonts_changed_p \ 24145 if (!it->f->fonts_changed \
24209 && (it->glyph_row->glyphs[area] \ 24146 && (it->glyph_row->glyphs[area] \
24210 < it->glyph_row->glyphs[area + 1])) \ 24147 < it->glyph_row->glyphs[area + 1])) \
24211 { \ 24148 { \
24212 it->w->ncols_scale_factor++; \ 24149 it->w->ncols_scale_factor++; \
24213 fonts_changed_p = 1; \ 24150 it->f->fonts_changed = 1; \
24214 } \ 24151 } \
24215 } 24152 }
24216 24153
@@ -25209,21 +25146,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
25209 base_height = it->ascent + it->descent; 25146 base_height = it->ascent + it->descent;
25210 base_width = font->average_width; 25147 base_width = font->average_width;
25211 25148
25212 /* Get a face ID for the glyph by utilizing a cache (the same way as 25149 face_id = merge_glyphless_glyph_face (it);
25213 done for `escape-glyph' in get_next_display_element). */
25214 if (it->f == last_glyphless_glyph_frame
25215 && it->face_id == last_glyphless_glyph_face_id)
25216 {
25217 face_id = last_glyphless_glyph_merged_face_id;
25218 }
25219 else
25220 {
25221 /* Merge the `glyphless-char' face into the current face. */
25222 face_id = merge_faces (it->f, Qglyphless_char, 0, it->face_id);
25223 last_glyphless_glyph_frame = it->f;
25224 last_glyphless_glyph_face_id = it->face_id;
25225 last_glyphless_glyph_merged_face_id = face_id;
25226 }
25227 25150
25228 if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE) 25151 if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
25229 { 25152 {
@@ -26037,7 +25960,7 @@ x_write_glyphs (struct window *w, struct glyph_row *updated_row,
26037 /* Write glyphs. */ 25960 /* Write glyphs. */
26038 25961
26039 hpos = start - updated_row->glyphs[updated_area]; 25962 hpos = start - updated_row->glyphs[updated_area];
26040 x = draw_glyphs (w, output_cursor.x, 25963 x = draw_glyphs (w, w->output_cursor.x,
26041 updated_row, updated_area, 25964 updated_row, updated_area,
26042 hpos, hpos + len, 25965 hpos, hpos + len,
26043 DRAW_NORMAL_TEXT, 0); 25966 DRAW_NORMAL_TEXT, 0);
@@ -26045,7 +25968,7 @@ x_write_glyphs (struct window *w, struct glyph_row *updated_row,
26045 /* Invalidate old phys cursor if the glyph at its hpos is redrawn. */ 25968 /* Invalidate old phys cursor if the glyph at its hpos is redrawn. */
26046 if (updated_area == TEXT_AREA 25969 if (updated_area == TEXT_AREA
26047 && w->phys_cursor_on_p 25970 && w->phys_cursor_on_p
26048 && w->phys_cursor.vpos == output_cursor.vpos 25971 && w->phys_cursor.vpos == w->output_cursor.vpos
26049 && chpos >= hpos 25972 && chpos >= hpos
26050 && chpos < hpos + len) 25973 && chpos < hpos + len)
26051 w->phys_cursor_on_p = 0; 25974 w->phys_cursor_on_p = 0;
@@ -26053,8 +25976,8 @@ x_write_glyphs (struct window *w, struct glyph_row *updated_row,
26053 unblock_input (); 25976 unblock_input ();
26054 25977
26055 /* Advance the output cursor. */ 25978 /* Advance the output cursor. */
26056 output_cursor.hpos += len; 25979 w->output_cursor.hpos += len;
26057 output_cursor.x = x; 25980 w->output_cursor.x = x;
26058} 25981}
26059 25982
26060 25983
@@ -26087,25 +26010,25 @@ x_insert_glyphs (struct window *w, struct glyph_row *updated_row,
26087 26010
26088 /* Get the width of the region to shift right. */ 26011 /* Get the width of the region to shift right. */
26089 shifted_region_width = (window_box_width (w, updated_area) 26012 shifted_region_width = (window_box_width (w, updated_area)
26090 - output_cursor.x 26013 - w->output_cursor.x
26091 - shift_by_width); 26014 - shift_by_width);
26092 26015
26093 /* Shift right. */ 26016 /* Shift right. */
26094 frame_x = window_box_left (w, updated_area) + output_cursor.x; 26017 frame_x = window_box_left (w, updated_area) + w->output_cursor.x;
26095 frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, output_cursor.y); 26018 frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, w->output_cursor.y);
26096 26019
26097 FRAME_RIF (f)->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width, 26020 FRAME_RIF (f)->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width,
26098 line_height, shift_by_width); 26021 line_height, shift_by_width);
26099 26022
26100 /* Write the glyphs. */ 26023 /* Write the glyphs. */
26101 hpos = start - row->glyphs[updated_area]; 26024 hpos = start - row->glyphs[updated_area];
26102 draw_glyphs (w, output_cursor.x, row, updated_area, 26025 draw_glyphs (w, w->output_cursor.x, row, updated_area,
26103 hpos, hpos + len, 26026 hpos, hpos + len,
26104 DRAW_NORMAL_TEXT, 0); 26027 DRAW_NORMAL_TEXT, 0);
26105 26028
26106 /* Advance the output cursor. */ 26029 /* Advance the output cursor. */
26107 output_cursor.hpos += len; 26030 w->output_cursor.hpos += len;
26108 output_cursor.x += shift_by_width; 26031 w->output_cursor.x += shift_by_width;
26109 unblock_input (); 26032 unblock_input ();
26110} 26033}
26111 26034
@@ -26144,16 +26067,16 @@ x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
26144 else 26067 else
26145 to_x = min (to_x, max_x); 26068 to_x = min (to_x, max_x);
26146 26069
26147 to_y = min (max_y, output_cursor.y + updated_row->height); 26070 to_y = min (max_y, w->output_cursor.y + updated_row->height);
26148 26071
26149 /* Notice if the cursor will be cleared by this operation. */ 26072 /* Notice if the cursor will be cleared by this operation. */
26150 if (!updated_row->full_width_p) 26073 if (!updated_row->full_width_p)
26151 notice_overwritten_cursor (w, updated_area, 26074 notice_overwritten_cursor (w, updated_area,
26152 output_cursor.x, -1, 26075 w->output_cursor.x, -1,
26153 updated_row->y, 26076 updated_row->y,
26154 MATRIX_ROW_BOTTOM_Y (updated_row)); 26077 MATRIX_ROW_BOTTOM_Y (updated_row));
26155 26078
26156 from_x = output_cursor.x; 26079 from_x = w->output_cursor.x;
26157 26080
26158 /* Translate to frame coordinates. */ 26081 /* Translate to frame coordinates. */
26159 if (updated_row->full_width_p) 26082 if (updated_row->full_width_p)
@@ -26169,7 +26092,7 @@ x_clear_end_of_line (struct window *w, struct glyph_row *updated_row,
26169 } 26092 }
26170 26093
26171 min_y = WINDOW_HEADER_LINE_HEIGHT (w); 26094 min_y = WINDOW_HEADER_LINE_HEIGHT (w);
26172 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, output_cursor.y)); 26095 from_y = WINDOW_TO_FRAME_PIXEL_Y (w, max (min_y, w->output_cursor.y));
26173 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y); 26096 to_y = WINDOW_TO_FRAME_PIXEL_Y (w, to_y);
26174 26097
26175 /* Prevent inadvertently clearing to end of the X window. */ 26098 /* Prevent inadvertently clearing to end of the X window. */
@@ -26267,7 +26190,7 @@ set_frame_cursor_types (struct frame *f, Lisp_Object arg)
26267 FRAME_BLINK_OFF_CURSOR (f) = DEFAULT_CURSOR; 26190 FRAME_BLINK_OFF_CURSOR (f) = DEFAULT_CURSOR;
26268 26191
26269 /* Make sure the cursor gets redrawn. */ 26192 /* Make sure the cursor gets redrawn. */
26270 cursor_type_changed = 1; 26193 f->cursor_type_changed = 1;
26271} 26194}
26272 26195
26273 26196
@@ -29037,7 +28960,7 @@ x_draw_vertical_border (struct window *w)
29037 { 28960 {
29038 int x0, x1, y0, y1; 28961 int x0, x1, y0, y1;
29039 28962
29040 window_box_edges (w, -1, &x0, &y0, &x1, &y1); 28963 window_box_edges (w, &x0, &y0, &x1, &y1);
29041 y1 -= 1; 28964 y1 -= 1;
29042 28965
29043 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) 28966 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@@ -29050,7 +28973,7 @@ x_draw_vertical_border (struct window *w)
29050 { 28973 {
29051 int x0, x1, y0, y1; 28974 int x0, x1, y0, y1;
29052 28975
29053 window_box_edges (w, -1, &x0, &y0, &x1, &y1); 28976 window_box_edges (w, &x0, &y0, &x1, &y1);
29054 y1 -= 1; 28977 y1 -= 1;
29055 28978
29056 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) 28979 if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@@ -29959,8 +29882,10 @@ cursor shapes. */);
29959 doc: /* Seconds to wait before displaying an hourglass pointer when Emacs is busy. */); 29882 doc: /* Seconds to wait before displaying an hourglass pointer when Emacs is busy. */);
29960 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); 29883 Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY);
29961 29884
29885#ifdef HAVE_WINDOW_SYSTEM
29962 hourglass_atimer = NULL; 29886 hourglass_atimer = NULL;
29963 hourglass_shown_p = 0; 29887 hourglass_shown_p = 0;
29888#endif /* HAVE_WINDOW_SYSTEM */
29964 29889
29965 DEFSYM (Qglyphless_char, "glyphless-char"); 29890 DEFSYM (Qglyphless_char, "glyphless-char");
29966 DEFSYM (Qhex_code, "hex-code"); 29891 DEFSYM (Qhex_code, "hex-code");
@@ -30002,8 +29927,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or
30002void 29927void
30003init_xdisp (void) 29928init_xdisp (void)
30004{ 29929{
30005 current_header_line_height = current_mode_line_height = -1;
30006
30007 CHARPOS (this_line_start_pos) = 0; 29930 CHARPOS (this_line_start_pos) = 0;
30008 29931
30009 if (!noninteractive) 29932 if (!noninteractive)
@@ -30047,13 +29970,14 @@ init_xdisp (void)
30047 help_echo_showing_p = 0; 29970 help_echo_showing_p = 0;
30048} 29971}
30049 29972
29973#ifdef HAVE_WINDOW_SYSTEM
29974
30050/* Platform-independent portion of hourglass implementation. */ 29975/* Platform-independent portion of hourglass implementation. */
30051 29976
30052/* Cancel a currently active hourglass timer, and start a new one. */ 29977/* Cancel a currently active hourglass timer, and start a new one. */
30053void 29978void
30054start_hourglass (void) 29979start_hourglass (void)
30055{ 29980{
30056#if defined (HAVE_WINDOW_SYSTEM)
30057 struct timespec delay; 29981 struct timespec delay;
30058 29982
30059 cancel_hourglass (); 29983 cancel_hourglass ();
@@ -30078,7 +30002,6 @@ start_hourglass (void)
30078 30002
30079 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, 30003 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
30080 show_hourglass, NULL); 30004 show_hourglass, NULL);
30081#endif
30082} 30005}
30083 30006
30084 30007
@@ -30087,7 +30010,6 @@ start_hourglass (void)
30087void 30010void
30088cancel_hourglass (void) 30011cancel_hourglass (void)
30089{ 30012{
30090#if defined (HAVE_WINDOW_SYSTEM)
30091 if (hourglass_atimer) 30013 if (hourglass_atimer)
30092 { 30014 {
30093 cancel_atimer (hourglass_atimer); 30015 cancel_atimer (hourglass_atimer);
@@ -30096,5 +30018,6 @@ cancel_hourglass (void)
30096 30018
30097 if (hourglass_shown_p) 30019 if (hourglass_shown_p)
30098 hide_hourglass (); 30020 hide_hourglass ();
30099#endif
30100} 30021}
30022
30023#endif /* HAVE_WINDOW_SYSTEM */