diff options
| author | Stefan Monnier | 2015-09-30 10:00:13 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-09-30 10:00:13 -0400 |
| commit | 8b1df960131a173779e88df605a21ebc0443634a (patch) | |
| tree | fbc9cb9cc1b64c9a923685662b7f0af2a54bb828 /src | |
| parent | 44298d3cf8749a89318422a2fb314dd4f3711961 (diff) | |
| download | emacs-8b1df960131a173779e88df605a21ebc0443634a.tar.gz emacs-8b1df960131a173779e88df605a21ebc0443634a.zip | |
Try to avoid redisplaying all frames when creating a new one
* src/xfns.c (x_set_menu_bar_lines, x_change_tool_bar_height):
* src/xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
(Finternal_set_lisp_face_attribute, update_face_from_frame_parameter):
* src/frame.c (x_set_screen_gamma): Set the specific frame's
`redisplay' bit rather than windows_or_buffers_changed.
* src/window.c (apply_window_adjustment): Remove redundant setting of
windows_or_buffers_changed.
* src/xdisp.c (redisplay_internal): Set the specific frame's
`redisplay' bit rather than update_mode_lines in response to
cursor_type_changed.
(syms_of_xdisp): Use hash-tables for redisplay_*_cause tables.
(AINC): Adjust accordingly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 4 | ||||
| -rw-r--r-- | src/window.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 17 | ||||
| -rw-r--r-- | src/xfaces.c | 28 | ||||
| -rw-r--r-- | src/xfns.c | 5 |
5 files changed, 32 insertions, 23 deletions
diff --git a/src/frame.c b/src/frame.c index 121c55fdb20..f1a78fbdbf8 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -3539,8 +3539,8 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu | |||
| 3539 | (f, bgcolor, Qnil); | 3539 | (f, bgcolor, Qnil); |
| 3540 | } | 3540 | } |
| 3541 | 3541 | ||
| 3542 | clear_face_cache (true); | 3542 | clear_face_cache (true); /* FIXME: Why of all frames? */ |
| 3543 | windows_or_buffers_changed = 70; | 3543 | fset_redisplay (f); |
| 3544 | } | 3544 | } |
| 3545 | 3545 | ||
| 3546 | 3546 | ||
diff --git a/src/window.c b/src/window.c index d61f586a7fb..6d06e548094 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -6609,7 +6609,6 @@ apply_window_adjustment (struct window *w) | |||
| 6609 | eassert (w); | 6609 | eassert (w); |
| 6610 | clear_glyph_matrix (w->current_matrix); | 6610 | clear_glyph_matrix (w->current_matrix); |
| 6611 | w->window_end_valid = false; | 6611 | w->window_end_valid = false; |
| 6612 | windows_or_buffers_changed = 30; | ||
| 6613 | wset_redisplay (w); | 6612 | wset_redisplay (w); |
| 6614 | adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); | 6613 | adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); |
| 6615 | } | 6614 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index 863d891c2de..259c36373bf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13432,7 +13432,7 @@ redisplay_internal (void) | |||
| 13432 | /* If cursor type has been changed on the frame | 13432 | /* If cursor type has been changed on the frame |
| 13433 | other than selected, consider all frames. */ | 13433 | other than selected, consider all frames. */ |
| 13434 | if (f != sf && f->cursor_type_changed) | 13434 | if (f != sf && f->cursor_type_changed) |
| 13435 | update_mode_lines = 31; | 13435 | fset_redisplay (f); |
| 13436 | } | 13436 | } |
| 13437 | clear_desired_matrices (f); | 13437 | clear_desired_matrices (f); |
| 13438 | } | 13438 | } |
| @@ -13530,9 +13530,12 @@ redisplay_internal (void) | |||
| 13530 | consider_all_windows_p = (update_mode_lines | 13530 | consider_all_windows_p = (update_mode_lines |
| 13531 | || windows_or_buffers_changed); | 13531 | || windows_or_buffers_changed); |
| 13532 | 13532 | ||
| 13533 | #define AINC(a,i) \ | 13533 | #define AINC(a,i) \ |
| 13534 | if (VECTORP (a) && i >= 0 && i < ASIZE (a) && INTEGERP (AREF (a, i))) \ | 13534 | { \ |
| 13535 | ASET (a, i, make_number (1 + XINT (AREF (a, i)))) | 13535 | Lisp_Object entry = Fgethash (make_number (i), a, make_number (0)); \ |
| 13536 | if (INTEGERP (entry)) \ | ||
| 13537 | Fputhash (make_number (i), make_number (1 + XINT (entry)), a); \ | ||
| 13538 | } | ||
| 13536 | 13539 | ||
| 13537 | AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed); | 13540 | AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed); |
| 13538 | AINC (Vredisplay__mode_lines_cause, update_mode_lines); | 13541 | AINC (Vredisplay__mode_lines_cause, update_mode_lines); |
| @@ -31387,13 +31390,11 @@ display table takes effect; in this case, Emacs does not consult | |||
| 31387 | 31390 | ||
| 31388 | DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause, | 31391 | DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause, |
| 31389 | doc: /* */); | 31392 | doc: /* */); |
| 31390 | Vredisplay__all_windows_cause | 31393 | Vredisplay__all_windows_cause = Fmake_hash_table (0, NULL); |
| 31391 | = Fmake_vector (make_number (100), make_number (0)); | ||
| 31392 | 31394 | ||
| 31393 | DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause, | 31395 | DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause, |
| 31394 | doc: /* */); | 31396 | doc: /* */); |
| 31395 | Vredisplay__mode_lines_cause | 31397 | Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL); |
| 31396 | = Fmake_vector (make_number (100), make_number (0)); | ||
| 31397 | } | 31398 | } |
| 31398 | 31399 | ||
| 31399 | 31400 | ||
diff --git a/src/xfaces.c b/src/xfaces.c index 40713f167ff..8cf0b427799 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -631,7 +631,7 @@ free_frame_faces (struct frame *f) | |||
| 631 | /* Clear face caches, and recompute basic faces for frame F. Call | 631 | /* Clear face caches, and recompute basic faces for frame F. Call |
| 632 | this after changing frame parameters on which those faces depend, | 632 | this after changing frame parameters on which those faces depend, |
| 633 | or when realized faces have been freed due to changing attributes | 633 | or when realized faces have been freed due to changing attributes |
| 634 | of named faces. */ | 634 | of named faces. */ |
| 635 | 635 | ||
| 636 | void | 636 | void |
| 637 | recompute_basic_faces (struct frame *f) | 637 | recompute_basic_faces (struct frame *f) |
| @@ -2528,10 +2528,15 @@ Value is a vector of face attributes. */) | |||
| 2528 | if (NILP (Fget (face, Qface_no_inherit))) | 2528 | if (NILP (Fget (face, Qface_no_inherit))) |
| 2529 | { | 2529 | { |
| 2530 | if (f) | 2530 | if (f) |
| 2531 | f->face_change = 1; | 2531 | { |
| 2532 | f->face_change = true; | ||
| 2533 | fset_redisplay (f); | ||
| 2534 | } | ||
| 2532 | else | 2535 | else |
| 2533 | face_change = true; | 2536 | { |
| 2534 | windows_or_buffers_changed = 54; | 2537 | face_change = true; |
| 2538 | windows_or_buffers_changed = 54; | ||
| 2539 | } | ||
| 2535 | } | 2540 | } |
| 2536 | 2541 | ||
| 2537 | eassert (LFACEP (lface)); | 2542 | eassert (LFACEP (lface)); |
| @@ -2613,10 +2618,15 @@ The value is TO. */) | |||
| 2613 | if (NILP (Fget (to, Qface_no_inherit))) | 2618 | if (NILP (Fget (to, Qface_no_inherit))) |
| 2614 | { | 2619 | { |
| 2615 | if (f) | 2620 | if (f) |
| 2616 | f->face_change = 1; | 2621 | { |
| 2622 | f->face_change = true; | ||
| 2623 | fset_redisplay (f); | ||
| 2624 | } | ||
| 2617 | else | 2625 | else |
| 2618 | face_change = true; | 2626 | { |
| 2619 | windows_or_buffers_changed = 55; | 2627 | face_change = true; |
| 2628 | windows_or_buffers_changed = 55; | ||
| 2629 | } | ||
| 2620 | } | 2630 | } |
| 2621 | 2631 | ||
| 2622 | return to; | 2632 | return to; |
| @@ -3120,7 +3130,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3120 | && NILP (Fequal (old_value, value))) | 3130 | && NILP (Fequal (old_value, value))) |
| 3121 | { | 3131 | { |
| 3122 | f->face_change = true; | 3132 | f->face_change = true; |
| 3123 | windows_or_buffers_changed = 56; | 3133 | fset_redisplay (f); |
| 3124 | } | 3134 | } |
| 3125 | 3135 | ||
| 3126 | if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) | 3136 | if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) |
| @@ -3293,7 +3303,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, | |||
| 3293 | && NILP (Fget (face, Qface_no_inherit))) | 3303 | && NILP (Fget (face, Qface_no_inherit))) |
| 3294 | { | 3304 | { |
| 3295 | f->face_change = true; | 3305 | f->face_change = true; |
| 3296 | windows_or_buffers_changed = 57; | 3306 | fset_redisplay (f); |
| 3297 | } | 3307 | } |
| 3298 | } | 3308 | } |
| 3299 | 3309 | ||
diff --git a/src/xfns.c b/src/xfns.c index d6a3d76e948..fc6111c4fab 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1041,7 +1041,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 1041 | nlines = 0; | 1041 | nlines = 0; |
| 1042 | 1042 | ||
| 1043 | /* Make sure we redisplay all windows in this frame. */ | 1043 | /* Make sure we redisplay all windows in this frame. */ |
| 1044 | windows_or_buffers_changed = 59; | 1044 | fset_redisplay (f); |
| 1045 | 1045 | ||
| 1046 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 1046 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| 1047 | FRAME_MENU_BAR_LINES (f) = 0; | 1047 | FRAME_MENU_BAR_LINES (f) = 0; |
| @@ -1160,8 +1160,7 @@ x_change_tool_bar_height (struct frame *f, int height) | |||
| 1160 | Lisp_Object fullscreen; | 1160 | Lisp_Object fullscreen; |
| 1161 | 1161 | ||
| 1162 | /* Make sure we redisplay all windows in this frame. */ | 1162 | /* Make sure we redisplay all windows in this frame. */ |
| 1163 | windows_or_buffers_changed = 60; | 1163 | fset_redisplay (f); |
| 1164 | |||
| 1165 | 1164 | ||
| 1166 | /* Recalculate tool bar and frame text sizes. */ | 1165 | /* Recalculate tool bar and frame text sizes. */ |
| 1167 | FRAME_TOOL_BAR_HEIGHT (f) = height; | 1166 | FRAME_TOOL_BAR_HEIGHT (f) = height; |