comparison src/redisplay.c @ 384:bbff43aa5eb7 r21-2-7

Import from CVS: tag r21-2-7
author cvs
date Mon, 13 Aug 2007 11:08:24 +0200
parents 8626e4521993
children 74fd4e045ea6
comparison
equal deleted inserted replaced
383:6a50c6a581a5 384:bbff43aa5eb7
254 struct glyph_block *gb, 254 struct glyph_block *gb,
255 int pos_type, int allow_cursor, 255 int pos_type, int allow_cursor,
256 struct glyph_cachel *cachel); 256 struct glyph_cachel *cachel);
257 static Bytind create_text_block (struct window *w, struct display_line *dl, 257 static Bytind create_text_block (struct window *w, struct display_line *dl,
258 Bytind bi_start_pos, int start_col, 258 Bytind bi_start_pos, int start_col,
259 prop_block_dynarr **prop, int type); 259 prop_block_dynarr **prop,
260 int type);
260 static int create_overlay_glyph_block (struct window *w, 261 static int create_overlay_glyph_block (struct window *w,
261 struct display_line *dl); 262 struct display_line *dl);
262 static void create_left_glyph_block (struct window *w, 263 static void create_left_glyph_block (struct window *w,
263 struct display_line *dl, 264 struct display_line *dl,
264 int overlay_width); 265 int overlay_width);
363 hscroll, control-arrow, etc) is in need of updating 364 hscroll, control-arrow, etc) is in need of updating
364 somewhere. */ 365 somewhere. */
365 int glyphs_changed; 366 int glyphs_changed;
366 int glyphs_changed_set; 367 int glyphs_changed_set;
367 368
369 /* non-zero if any displayed subwindow is in need of updating
370 somewhere. */
371 int subwindows_changed;
372 int subwindows_changed_set;
373
368 /* This variable is 1 if the icon has to be updated. 374 /* This variable is 1 if the icon has to be updated.
369 It is set to 1 when `frame-icon-glyph' changes. */ 375 It is set to 1 when `frame-icon-glyph' changes. */
370 int icon_changed; 376 int icon_changed;
371 int icon_changed_set; 377 int icon_changed_set;
372 378
679 window. */ 685 window. */
680 686
681 static Bufpos 687 static Bufpos
682 generate_display_line (struct window *w, struct display_line *dl, int bounds, 688 generate_display_line (struct window *w, struct display_line *dl, int bounds,
683 Bufpos start_pos, int start_col, 689 Bufpos start_pos, int start_col,
684 prop_block_dynarr **prop, int type) 690 prop_block_dynarr **prop,
691 int type)
685 { 692 {
686 Bufpos ret_bufpos; 693 Bufpos ret_bufpos;
687 int overlay_width; 694 int overlay_width;
688 struct buffer *b = XBUFFER (WINDOW_BUFFER (w)); 695 struct buffer *b = XBUFFER (WINDOW_BUFFER (w));
689 696
1231 { 1238 {
1232 return add_octal_runes (data); 1239 return add_octal_runes (data);
1233 } 1240 }
1234 } 1241 }
1235 1242
1243 static prop_block_dynarr *
1244 add_disp_table_entry_runes_1 (pos_data *data, Lisp_Object entry)
1245 {
1246 prop_block_dynarr *prop = NULL;
1247
1248 if (STRINGP (entry))
1249 {
1250 prop = add_bufbyte_string_runes (data,
1251 XSTRING_DATA (entry),
1252 XSTRING_LENGTH (entry),
1253 0);
1254 }
1255 else if (GLYPHP (entry))
1256 {
1257 if (data->start_col)
1258 data->start_col--;
1259
1260 if (!data->start_col && data->bi_start_col_enabled)
1261 {
1262 prop = add_hscroll_rune (data);
1263 }
1264 else
1265 {
1266 struct glyph_block gb;
1267
1268 gb.glyph = entry;
1269 gb.extent = Qnil;
1270 prop = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0);
1271 }
1272 }
1273 else if (CHAR_OR_CHAR_INTP (entry))
1274 {
1275 data->ch = XCHAR_OR_CHAR_INT (entry);
1276 prop = add_emchar_rune (data);
1277 }
1278 else if (CONSP (entry))
1279 {
1280 if (EQ (XCAR (entry), Qformat)
1281 && CONSP (XCDR (entry))
1282 && STRINGP (XCAR (XCDR (entry))))
1283 {
1284 Lisp_Object format = XCAR (XCDR (entry));
1285 Bytind len = XSTRING_LENGTH (format);
1286 Bufbyte *src = XSTRING_DATA (format), *end = src + len;
1287 Bufbyte *result = alloca_array (Bufbyte, len);
1288 Bufbyte *dst = result;
1289
1290 while (src < end)
1291 {
1292 Emchar c = charptr_emchar (src);
1293 INC_CHARPTR (src);
1294 if (c != '%' || src == end)
1295 dst += set_charptr_emchar (dst, c);
1296 else
1297 {
1298 c = charptr_emchar (src);
1299 INC_CHARPTR (src);
1300 switch (c)
1301 {
1302 /*case 'x':
1303 dst += long_to_string_base ((char *)dst, data->ch, 16);
1304 break;*/
1305 case '%':
1306 dst += set_charptr_emchar (dst, '%');
1307 break;
1308 }
1309 }
1310 }
1311 prop = add_bufbyte_string_runes (data, result, dst - result, 0);
1312 }
1313 }
1314
1315 /* Else blow it off because someone added a bad entry and we don't
1316 have any safe way of signaling an error. */
1317 return prop;
1318 }
1319
1236 /* Given a display table entry, call the appropriate functions to 1320 /* Given a display table entry, call the appropriate functions to
1237 display each element of the entry. */ 1321 display each element of the entry. */
1238 1322
1239 static prop_block_dynarr * 1323 static prop_block_dynarr *
1240 add_disp_table_entry_runes (pos_data *data, Lisp_Object entry) 1324 add_disp_table_entry_runes (pos_data *data, Lisp_Object entry)
1241 { 1325 {
1242 prop_block_dynarr *prop = NULL; 1326 prop_block_dynarr *prop = NULL;
1243
1244 if (VECTORP (entry)) 1327 if (VECTORP (entry))
1245 { 1328 {
1246 struct Lisp_Vector *de = XVECTOR (entry); 1329 struct Lisp_Vector *de = XVECTOR (entry);
1247 long len = vector_length (de); 1330 EMACS_INT len = vector_length (de);
1248 int elt; 1331 int elt;
1249 1332
1250 for (elt = 0; elt < len; elt++) 1333 for (elt = 0; elt < len; elt++)
1251 { 1334 {
1252 if (NILP (de->contents[elt])) 1335 if (NILP (vector_data (de)[elt]))
1253 continue; 1336 continue;
1254 else if (STRINGP (de->contents[elt])) 1337 else
1255 { 1338 prop = add_disp_table_entry_runes_1 (data, vector_data (de)[elt]);
1256 prop =
1257 add_bufbyte_string_runes
1258 (data,
1259 XSTRING_DATA (de->contents[elt]),
1260 XSTRING_LENGTH (de->contents[elt]),
1261 0);
1262 }
1263 else if (GLYPHP (de->contents[elt]))
1264 {
1265 if (data->start_col)
1266 data->start_col--;
1267
1268 if (!data->start_col && data->bi_start_col_enabled)
1269 {
1270 prop = add_hscroll_rune (data);
1271 }
1272 else
1273 {
1274 struct glyph_block gb;
1275
1276 gb.glyph = de->contents[elt];
1277 gb.extent = Qnil;
1278 prop = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0);
1279 }
1280 }
1281 else if (CHAR_OR_CHAR_INTP (de->contents[elt]))
1282 {
1283 data->ch = XCHAR_OR_CHAR_INT (de->contents[elt]);
1284 prop = add_emchar_rune (data);
1285 }
1286 /* Else blow it off because someone added a bad entry and we 1339 /* Else blow it off because someone added a bad entry and we
1287 don't have any safe way of signaling an error. */ 1340 don't have any safe way of signaling an error. Hey, this
1341 comment sounds familiar. */
1288 1342
1289 /* #### Still need to add any remaining elements to the 1343 /* #### Still need to add any remaining elements to the
1290 propagation information. */ 1344 propagation information. */
1291 if (prop) 1345 if (prop)
1292 return prop; 1346 return prop;
1293 } 1347 }
1294 } 1348 }
1295 else if (STRINGP (entry)) 1349 else
1296 { 1350 prop = add_disp_table_entry_runes_1 (data, entry);
1297 prop = add_bufbyte_string_runes (data,
1298 XSTRING_DATA (entry),
1299 XSTRING_LENGTH (entry),
1300 0);
1301 }
1302 else if (GLYPHP (entry))
1303 {
1304 if (data->start_col)
1305 data->start_col--;
1306
1307 if (!data->start_col && data->bi_start_col_enabled)
1308 {
1309 prop = add_hscroll_rune (data);
1310 }
1311 else
1312 {
1313 struct glyph_block gb;
1314
1315 gb.glyph = entry;
1316 gb.extent = Qnil;
1317 prop = add_glyph_rune (data, &gb, BEGIN_GLYPHS, 0, 0);
1318 }
1319 }
1320 else if (CHAR_OR_CHAR_INTP (entry))
1321 {
1322 data->ch = XCHAR_OR_CHAR_INT (entry);
1323 prop = add_emchar_rune (data);
1324 }
1325
1326 /* Else blow it off because someone added a bad entry and we don't
1327 have any safe way of signaling an error. Hey, this comment
1328 sounds familiar. */
1329 return prop; 1351 return prop;
1330 } 1352 }
1331 1353
1332 /* Add runes which were propagated from the previous line. */ 1354 /* Add runes which were propagated from the previous line. */
1333 1355
1742 You must do appropriate conversion. */ 1764 You must do appropriate conversion. */
1743 1765
1744 static Bytind 1766 static Bytind
1745 create_text_block (struct window *w, struct display_line *dl, 1767 create_text_block (struct window *w, struct display_line *dl,
1746 Bytind bi_start_pos, int start_col, 1768 Bytind bi_start_pos, int start_col,
1747 prop_block_dynarr **prop, int type) 1769 prop_block_dynarr **prop,
1770 int type)
1748 { 1771 {
1749 struct frame *f = XFRAME (w->frame); 1772 struct frame *f = XFRAME (w->frame);
1750 struct buffer *b = XBUFFER (w->buffer); 1773 struct buffer *b = XBUFFER (w->buffer);
1751 struct device *d = XDEVICE (f->device); 1774 struct device *d = XDEVICE (f->device);
1752 1775
1753 pos_data data; 1776 pos_data data;
1754 struct Lisp_Vector *dt = 0;
1755 1777
1756 /* Don't display anything in the minibuffer if this window is not on 1778 /* Don't display anything in the minibuffer if this window is not on
1757 a selected frame. We consider all other windows to be active 1779 a selected frame. We consider all other windows to be active
1758 minibuffers as it simplifies the coding. */ 1780 minibuffers as it simplifies the coding. */
1759 int active_minibuffer = (!MINI_WINDOW_P (w) || 1781 int active_minibuffer = (!MINI_WINDOW_P (w) ||
1782 but that's bogus -- we need a more general solution. I 1804 but that's bogus -- we need a more general solution. I
1783 think you need to extend the concept of display tables 1805 think you need to extend the concept of display tables
1784 into a more general conversion mechanism. Ideally you 1806 into a more general conversion mechanism. Ideally you
1785 could specify a Lisp function that converts characters, 1807 could specify a Lisp function that converts characters,
1786 but this violates the Second Golden Rule and besides would 1808 but this violates the Second Golden Rule and besides would
1787 make things way way way way slow. An idea I like is to 1809 make things way way way way slow.
1788 be able to specify multiple display tables instead of just 1810
1789 one. Each display table can specify conversions for some 1811 So instead, we extend the display-table concept, which was
1790 characters and leave others unchanged. The way the 1812 historically limited to 256-byte vectors, to one of the
1791 character gets displayed is determined by the first display 1813 following:
1792 table with a binding for that character. This way, you 1814
1793 could call a function `enable-hex-display' that adds a 1815 a) A 256-entry vector, for backward compatibility;
1794 pre-defined hex display-table (or maybe computes one if 1816 b) char-table, mapping characters to values;
1795 you give weird parameters to the function) and adds it 1817 c) range-table, mapping ranges of characters to values;
1796 to the list of display tables for the current buffer. 1818 d) a list of the above.
1797 1819
1798 Unfortunately there are still problems dealing with Mule 1820 The (d) option allows you to specify multiple display tables
1799 characters. For example, maybe I want to specify that 1821 instead of just one. Each display table can specify conversions
1800 all extended characters (i.e. >= 256) are displayed in hex. 1822 for some characters and leave others unchanged. The way the
1801 It's not reasonable to create a mapping for all possible 1823 character gets displayed is determined by the first display table
1802 such characters, because there are about 2^19 of them. 1824 with a binding for that character. This way, you could call a
1803 One way of dealing with this is to extend the concept 1825 function `enable-hex-display' that adds a hex display-table to
1804 of what a display table is. Currently it's only allowed 1826 the list of display tables for the current buffer.
1805 to be a 256-entry vector. Instead, it should be something 1827
1806 like: 1828 #### ...not yet implemented... Also, we extend the concept of
1807 1829 "mapping" to include a printf-like spec. Thus you can make all
1808 a) A 256-entry vector, for backward compatibility 1830 extended characters show up as hex with a display table like
1809 b) Some sort of hash table, mapping characters to values 1831 this:
1810 c) A list that specifies a range of values and the 1832
1811 mapping to provide for those values. 1833 #s(range-table data ((256 524288) (format "%x")))
1812
1813 Also, extend the concept of "mapping" to include a
1814 printf-like spec. Then, you could make all extended
1815 characters show up as hex with a display table like
1816
1817 ((256 . 524288) . "%x")
1818 1834
1819 Since more than one display table is possible, you have 1835 Since more than one display table is possible, you have
1820 great flexibility in mapping ranges of characters. 1836 great flexibility in mapping ranges of characters. */
1821 */
1822 Emchar printable_min = (CHAR_OR_CHAR_INTP (b->ctl_arrow) 1837 Emchar printable_min = (CHAR_OR_CHAR_INTP (b->ctl_arrow)
1823 ? XCHAR_OR_CHAR_INT (b->ctl_arrow) 1838 ? XCHAR_OR_CHAR_INT (b->ctl_arrow)
1824 : ((EQ (b->ctl_arrow, Qt) || EQ (b->ctl_arrow, Qnil)) 1839 : ((EQ (b->ctl_arrow, Qt) || EQ (b->ctl_arrow, Qnil))
1825 ? 255 : 160)); 1840 ? 255 : 160));
1841
1842 Lisp_Object face_dt, window_dt;
1826 1843
1827 /* The text display block for this display line. */ 1844 /* The text display block for this display line. */
1828 struct display_block *db = get_display_block_from_line (dl, TEXT); 1845 struct display_block *db = get_display_block_from_line (dl, TEXT);
1829 1846
1830 /* The first time through the main loop we need to force the glyph 1847 /* The first time through the main loop we need to force the glyph
1960 /* Now compute the face and begin/end-glyph information. */ 1977 /* Now compute the face and begin/end-glyph information. */
1961 data.findex = 1978 data.findex =
1962 /* Remember that the extent-fragment routines deal in Bytind's. */ 1979 /* Remember that the extent-fragment routines deal in Bytind's. */
1963 extent_fragment_update (w, data.ef, data.bi_bufpos); 1980 extent_fragment_update (w, data.ef, data.bi_bufpos);
1964 1981
1982 get_display_tables (w, data.findex, &face_dt, &window_dt);
1983
1965 if (data.bi_bufpos == data.ef->end) 1984 if (data.bi_bufpos == data.ef->end)
1966 no_more_frags = 1; 1985 no_more_frags = 1;
1967
1968 dt = get_display_table (w, data.findex);
1969 } 1986 }
1970 initial = 0; 1987 initial = 0;
1971 1988
1972 /* Determine what is next to be displayed. We first handle any 1989 /* Determine what is next to be displayed. We first handle any
1973 glyphs returned by glyphs_at_bufpos. If there are no glyphs to 1990 glyphs returned by glyphs_at_bufpos. If there are no glyphs to
2075 else if (data.bi_bufpos == BI_BUF_ZV (b)) 2092 else if (data.bi_bufpos == BI_BUF_ZV (b))
2076 goto done; 2093 goto done;
2077 2094
2078 else 2095 else
2079 { 2096 {
2097 Lisp_Object entry = Qnil;
2080 /* Get the character at the current buffer position. */ 2098 /* Get the character at the current buffer position. */
2081 data.ch = BI_BUF_FETCH_CHAR (b, data.bi_bufpos); 2099 data.ch = BI_BUF_FETCH_CHAR (b, data.bi_bufpos);
2100 if (!NILP (face_dt) || !NILP (window_dt))
2101 entry = display_table_entry (data.ch, face_dt, window_dt);
2082 2102
2083 /* If there is a display table entry for it, hand it off to 2103 /* If there is a display table entry for it, hand it off to
2084 add_disp_table_entry_runes and let it worry about it. */ 2104 add_disp_table_entry_runes and let it worry about it. */
2085 if (dt && !NILP (DISP_CHAR_ENTRY (dt, data.ch))) 2105 if (!NILP (entry) && !EQ (entry, make_char (data.ch)))
2086 { 2106 {
2087 *prop = 2107 *prop = add_disp_table_entry_runes (&data, entry);
2088 add_disp_table_entry_runes (&data,
2089 DISP_CHAR_ENTRY (dt, data.ch));
2090 2108
2091 if (*prop) 2109 if (*prop)
2092 goto done; 2110 goto done;
2093 } 2111 }
2094 2112
4308 if (start_pos > BUF_ZV (b)) 4326 if (start_pos > BUF_ZV (b))
4309 break; 4327 break;
4310 } 4328 }
4311 4329
4312 if (prop) 4330 if (prop)
4313 Dynarr_free (prop); 4331 Dynarr_free (prop);
4314 4332
4315 /* #### More not quite right, but close enough. */ 4333 /* #### More not quite right, but close enough. */
4316 /* #### Ben sez: apparently window_end_pos[] is measured 4334 /* #### Ben sez: apparently window_end_pos[] is measured
4317 as the number of characters between the window end and the 4335 as the number of characters between the window end and the
4318 end of the buffer? This seems rather weirdo. What's 4336 end of the buffer? This seems rather weirdo. What's
4623 } 4641 }
4624 4642
4625 /* If the changes are below the visible area then if point hasn't 4643 /* If the changes are below the visible area then if point hasn't
4626 moved return success otherwise fail in order to be safe. */ 4644 moved return success otherwise fail in order to be safe. */
4627 if (line > dla_end) 4645 if (line > dla_end)
4628 { 4646 return regenerate_window_extents_only_changed (w, startp, pointm,
4629 return regenerate_window_extents_only_changed (w, startp, pointm, 4647 extent_beg_unchanged,
4630 extent_beg_unchanged, 4648 extent_end_unchanged);
4631 extent_end_unchanged);
4632 }
4633 else 4649 else
4634 /* At this point we know what line the changes first affect. We 4650 /* At this point we know what line the changes first affect. We
4635 now redraw that line. If the changes are contained within it 4651 now redraw that line. If the changes are contained within it
4636 we are going to succeed and can update just that one line. 4652 we are going to succeed and can update just that one line.
4637 Otherwise we fail. If we fail we will have altered the desired 4653 Otherwise we fail. If we fail we will have altered the desired
4751 the line because we checked before entering the loop. */ 4767 the line because we checked before entering the loop. */
4752 if (extent_beg_unchanged != -1 4768 if (extent_beg_unchanged != -1
4753 && extent_end_unchanged != -1 4769 && extent_end_unchanged != -1
4754 && ((extent_beg_unchanged < ddl->bufpos) 4770 && ((extent_beg_unchanged < ddl->bufpos)
4755 || (extent_end_unchanged > ddl->end_bufpos))) 4771 || (extent_end_unchanged > ddl->end_bufpos)))
4756 { 4772 return regenerate_window_extents_only_changed (w, startp, pointm,
4757 return 4773 extent_beg_unchanged,
4758 regenerate_window_extents_only_changed (w, startp, pointm, 4774 extent_end_unchanged);
4759 extent_beg_unchanged,
4760 extent_end_unchanged);
4761 }
4762 else 4775 else
4763 return 1; 4776 return 1;
4764 } 4777 }
4765 } 4778 }
4766 4779
5079 && !w->windows_changed 5092 && !w->windows_changed
5080 && !f->clip_changed 5093 && !f->clip_changed
5081 && !f->extents_changed 5094 && !f->extents_changed
5082 && !f->faces_changed 5095 && !f->faces_changed
5083 && !f->glyphs_changed 5096 && !f->glyphs_changed
5097 && !f->subwindows_changed
5084 && !f->point_changed 5098 && !f->point_changed
5085 && !f->windows_structure_changed) 5099 && !f->windows_structure_changed)
5086 { 5100 {
5087 /* If not, we're done. */ 5101 /* If not, we're done. */
5088 if (f->modeline_changed) 5102 if (f->modeline_changed)
5099 if (!w->windows_changed 5113 if (!w->windows_changed
5100 && !f->clip_changed 5114 && !f->clip_changed
5101 && !f->extents_changed 5115 && !f->extents_changed
5102 && !f->faces_changed 5116 && !f->faces_changed
5103 && !f->glyphs_changed 5117 && !f->glyphs_changed
5118 && !f->subwindows_changed
5104 && !f->windows_structure_changed) 5119 && !f->windows_structure_changed)
5105 { 5120 {
5106 if (point_visible (w, pointm, CURRENT_DISP) 5121 if (point_visible (w, pointm, CURRENT_DISP)
5107 && w->last_point_x[CURRENT_DISP] != -1 5122 && w->last_point_x[CURRENT_DISP] != -1
5108 && w->last_point_y[CURRENT_DISP] != -1) 5123 && w->last_point_y[CURRENT_DISP] != -1)
5156 knowledge of what changed in the buffer. */ 5171 knowledge of what changed in the buffer. */
5157 else if (!w->windows_changed 5172 else if (!w->windows_changed
5158 && !f->clip_changed 5173 && !f->clip_changed
5159 && !f->faces_changed 5174 && !f->faces_changed
5160 && !f->glyphs_changed 5175 && !f->glyphs_changed
5176 && !f->subwindows_changed
5161 && !f->windows_structure_changed 5177 && !f->windows_structure_changed
5162 && !f->frame_changed 5178 && !f->frame_changed
5163 && !truncation_changed 5179 && !truncation_changed
5164 && pointm >= startp 5180 && pointm >= startp
5165 && regenerate_window_incrementally (w, startp, pointm)) 5181 && regenerate_window_incrementally (w, startp, pointm))
5372 the menubar's visibility. This way we avoid having flashing 5388 the menubar's visibility. This way we avoid having flashing
5373 caused by an Expose event generated by the visibility change 5389 caused by an Expose event generated by the visibility change
5374 being handled. */ 5390 being handled. */
5375 update_frame_menubars (f); 5391 update_frame_menubars (f);
5376 #endif /* HAVE_MENUBARS */ 5392 #endif /* HAVE_MENUBARS */
5377 5393 /* widgets are similar to menus in that they can call lisp to
5394 determine activation etc. Therefore update them before we get
5395 into redisplay. This is primarily for connected widgets such as
5396 radio buttons. */
5397 update_frame_subwindows (f);
5378 #ifdef HAVE_TOOLBARS 5398 #ifdef HAVE_TOOLBARS
5379 /* Update the toolbars. */ 5399 /* Update the toolbars. */
5380 update_frame_toolbars (f); 5400 update_frame_toolbars (f);
5381 #endif /* HAVE_TOOLBARS */ 5401 #endif /* HAVE_TOOLBARS */
5382 5402
5410 if (f->clear) 5430 if (f->clear)
5411 f->frame_changed = 1; 5431 f->frame_changed = 1;
5412 5432
5413 /* Erase the frame before outputting its contents. */ 5433 /* Erase the frame before outputting its contents. */
5414 if (f->clear) 5434 if (f->clear)
5415 DEVMETH (d, clear_frame, (f)); 5435 {
5436 DEVMETH (d, clear_frame, (f));
5437 }
5438
5439 /* invalidate the subwindow cache. we are going to reuse the glyphs
5440 flag here to cause subwindows to get instantiated. This is
5441 because subwindows changed is less strict - dealing with things
5442 like the clicked state of button. */
5443 if (!Dynarr_length (f->subwindow_cachels)
5444 || f->glyphs_changed
5445 || f->frame_changed)
5446 reset_subwindow_cachels (f);
5447 else
5448 mark_subwindow_cachels_as_not_updated (f);
5416 5449
5417 /* Do the selected window first. */ 5450 /* Do the selected window first. */
5418 redisplay_window (FRAME_SELECTED_WINDOW (f), 0); 5451 redisplay_window (FRAME_SELECTED_WINDOW (f), 0);
5419 5452
5420 /* Then do the rest. */ 5453 /* Then do the rest. */
5432 f->clip_changed = 0; 5465 f->clip_changed = 0;
5433 f->extents_changed = 0; 5466 f->extents_changed = 0;
5434 f->faces_changed = 0; 5467 f->faces_changed = 0;
5435 f->frame_changed = 0; 5468 f->frame_changed = 0;
5436 f->glyphs_changed = 0; 5469 f->glyphs_changed = 0;
5470 f->subwindows_changed = 0;
5437 f->icon_changed = 0; 5471 f->icon_changed = 0;
5438 f->menubar_changed = 0; 5472 f->menubar_changed = 0;
5439 f->modeline_changed = 0; 5473 f->modeline_changed = 0;
5440 f->point_changed = 0; 5474 f->point_changed = 0;
5441 f->toolbar_changed = 0; 5475 f->toolbar_changed = 0;
5495 { 5529 {
5496 if (f->buffers_changed || f->clip_changed || f->extents_changed || 5530 if (f->buffers_changed || f->clip_changed || f->extents_changed ||
5497 f->faces_changed || f->frame_changed || f->menubar_changed || 5531 f->faces_changed || f->frame_changed || f->menubar_changed ||
5498 f->modeline_changed || f->point_changed || f->size_changed || 5532 f->modeline_changed || f->point_changed || f->size_changed ||
5499 f->toolbar_changed || f->windows_changed || f->size_slipped || 5533 f->toolbar_changed || f->windows_changed || f->size_slipped ||
5500 f->windows_structure_changed || f->glyphs_changed) 5534 f->windows_structure_changed || f->glyphs_changed || f->subwindows_changed)
5501 { 5535 {
5502 preempted = redisplay_frame (f, 0); 5536 preempted = redisplay_frame (f, 0);
5503 } 5537 }
5504 5538
5505 if (preempted) 5539 if (preempted)
5530 if (f->buffers_changed || f->clip_changed || f->extents_changed || 5564 if (f->buffers_changed || f->clip_changed || f->extents_changed ||
5531 f->faces_changed || f->frame_changed || f->menubar_changed || 5565 f->faces_changed || f->frame_changed || f->menubar_changed ||
5532 f->modeline_changed || f->point_changed || f->size_changed || 5566 f->modeline_changed || f->point_changed || f->size_changed ||
5533 f->toolbar_changed || f->windows_changed || 5567 f->toolbar_changed || f->windows_changed ||
5534 f->windows_structure_changed || 5568 f->windows_structure_changed ||
5535 f->glyphs_changed) 5569 f->glyphs_changed || f->subwindows_changed)
5536 { 5570 {
5537 preempted = redisplay_frame (f, 0); 5571 preempted = redisplay_frame (f, 0);
5538 } 5572 }
5539 5573
5540 if (preempted) 5574 if (preempted)
5551 d->clip_changed = 0; 5585 d->clip_changed = 0;
5552 d->extents_changed = 0; 5586 d->extents_changed = 0;
5553 d->faces_changed = 0; 5587 d->faces_changed = 0;
5554 d->frame_changed = 0; 5588 d->frame_changed = 0;
5555 d->glyphs_changed = 0; 5589 d->glyphs_changed = 0;
5590 d->subwindows_changed = 0;
5556 d->icon_changed = 0; 5591 d->icon_changed = 0;
5557 d->menubar_changed = 0; 5592 d->menubar_changed = 0;
5558 d->modeline_changed = 0; 5593 d->modeline_changed = 0;
5559 d->point_changed = 0; 5594 d->point_changed = 0;
5560 d->toolbar_changed = 0; 5595 d->toolbar_changed = 0;
5596 5631
5597 if (!buffers_changed && !clip_changed && !extents_changed && 5632 if (!buffers_changed && !clip_changed && !extents_changed &&
5598 !faces_changed && !frame_changed && !icon_changed && 5633 !faces_changed && !frame_changed && !icon_changed &&
5599 !menubar_changed && !modeline_changed && !point_changed && 5634 !menubar_changed && !modeline_changed && !point_changed &&
5600 !size_changed && !toolbar_changed && !windows_changed && 5635 !size_changed && !toolbar_changed && !windows_changed &&
5601 !glyphs_changed && 5636 !glyphs_changed && !subwindows_changed &&
5602 !windows_structure_changed && !disable_preemption && 5637 !windows_structure_changed && !disable_preemption &&
5603 preemption_count < max_preempts) 5638 preemption_count < max_preempts)
5604 goto done; 5639 goto done;
5605 5640
5606 DEVICE_LOOP_NO_BREAK (devcons, concons) 5641 DEVICE_LOOP_NO_BREAK (devcons, concons)
5611 if (d->buffers_changed || d->clip_changed || d->extents_changed || 5646 if (d->buffers_changed || d->clip_changed || d->extents_changed ||
5612 d->faces_changed || d->frame_changed || d->icon_changed || 5647 d->faces_changed || d->frame_changed || d->icon_changed ||
5613 d->menubar_changed || d->modeline_changed || d->point_changed || 5648 d->menubar_changed || d->modeline_changed || d->point_changed ||
5614 d->size_changed || d->toolbar_changed || d->windows_changed || 5649 d->size_changed || d->toolbar_changed || d->windows_changed ||
5615 d->windows_structure_changed || 5650 d->windows_structure_changed ||
5616 d->glyphs_changed) 5651 d->glyphs_changed || d->subwindows_changed)
5617 { 5652 {
5618 preempted = redisplay_device (d); 5653 preempted = redisplay_device (d);
5619 5654
5620 if (preempted) 5655 if (preempted)
5621 { 5656 {
5635 buffers_changed = 0; 5670 buffers_changed = 0;
5636 clip_changed = 0; 5671 clip_changed = 0;
5637 extents_changed = 0; 5672 extents_changed = 0;
5638 frame_changed = 0; 5673 frame_changed = 0;
5639 glyphs_changed = 0; 5674 glyphs_changed = 0;
5675 subwindows_changed = 0;
5640 icon_changed = 0; 5676 icon_changed = 0;
5641 menubar_changed = 0; 5677 menubar_changed = 0;
5642 modeline_changed = 0; 5678 modeline_changed = 0;
5643 point_changed = 0; 5679 point_changed = 0;
5644 toolbar_changed = 0; 5680 toolbar_changed = 0;