Commit 8b1df960 authored by Stefan Monnier's avatar Stefan Monnier

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.
parent 44298d3c
......@@ -3539,8 +3539,8 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
(f, bgcolor, Qnil);
}
clear_face_cache (true);
windows_or_buffers_changed = 70;
clear_face_cache (true); /* FIXME: Why of all frames? */
fset_redisplay (f);
}
......
......@@ -6609,7 +6609,6 @@ apply_window_adjustment (struct window *w)
eassert (w);
clear_glyph_matrix (w->current_matrix);
w->window_end_valid = false;
windows_or_buffers_changed = 30;
wset_redisplay (w);
adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
}
......
......@@ -13432,7 +13432,7 @@ redisplay_internal (void)
/* If cursor type has been changed on the frame
other than selected, consider all frames. */
if (f != sf && f->cursor_type_changed)
update_mode_lines = 31;
fset_redisplay (f);
}
clear_desired_matrices (f);
}
......@@ -13530,9 +13530,12 @@ redisplay_internal (void)
consider_all_windows_p = (update_mode_lines
|| windows_or_buffers_changed);
#define AINC(a,i) \
if (VECTORP (a) && i >= 0 && i < ASIZE (a) && INTEGERP (AREF (a, i))) \
ASET (a, i, make_number (1 + XINT (AREF (a, i))))
#define AINC(a,i) \
{ \
Lisp_Object entry = Fgethash (make_number (i), a, make_number (0)); \
if (INTEGERP (entry)) \
Fputhash (make_number (i), make_number (1 + XINT (entry)), a); \
}
AINC (Vredisplay__all_windows_cause, windows_or_buffers_changed);
AINC (Vredisplay__mode_lines_cause, update_mode_lines);
......@@ -31387,13 +31390,11 @@ display table takes effect; in this case, Emacs does not consult
DEFVAR_LISP ("redisplay--all-windows-cause", Vredisplay__all_windows_cause,
doc: /* */);
Vredisplay__all_windows_cause
= Fmake_vector (make_number (100), make_number (0));
Vredisplay__all_windows_cause = Fmake_hash_table (0, NULL);
DEFVAR_LISP ("redisplay--mode-lines-cause", Vredisplay__mode_lines_cause,
doc: /* */);
Vredisplay__mode_lines_cause
= Fmake_vector (make_number (100), make_number (0));
Vredisplay__mode_lines_cause = Fmake_hash_table (0, NULL);
}
......
......@@ -631,7 +631,7 @@ free_frame_faces (struct frame *f)
/* Clear face caches, and recompute basic faces for frame F. Call
this after changing frame parameters on which those faces depend,
or when realized faces have been freed due to changing attributes
of named faces. */
of named faces. */
void
recompute_basic_faces (struct frame *f)
......@@ -2528,10 +2528,15 @@ Value is a vector of face attributes. */)
if (NILP (Fget (face, Qface_no_inherit)))
{
if (f)
f->face_change = 1;
{
f->face_change = true;
fset_redisplay (f);
}
else
face_change = true;
windows_or_buffers_changed = 54;
{
face_change = true;
windows_or_buffers_changed = 54;
}
}
eassert (LFACEP (lface));
......@@ -2613,10 +2618,15 @@ The value is TO. */)
if (NILP (Fget (to, Qface_no_inherit)))
{
if (f)
f->face_change = 1;
{
f->face_change = true;
fset_redisplay (f);
}
else
face_change = true;
windows_or_buffers_changed = 55;
{
face_change = true;
windows_or_buffers_changed = 55;
}
}
return to;
......@@ -3120,7 +3130,7 @@ FRAME 0 means change the face on all frames, and change the default
&& NILP (Fequal (old_value, value)))
{
f->face_change = true;
windows_or_buffers_changed = 56;
fset_redisplay (f);
}
if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
......@@ -3293,7 +3303,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
&& NILP (Fget (face, Qface_no_inherit)))
{
f->face_change = true;
windows_or_buffers_changed = 57;
fset_redisplay (f);
}
}
......
......@@ -1041,7 +1041,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
nlines = 0;
/* Make sure we redisplay all windows in this frame. */
windows_or_buffers_changed = 59;
fset_redisplay (f);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
FRAME_MENU_BAR_LINES (f) = 0;
......@@ -1160,8 +1160,7 @@ x_change_tool_bar_height (struct frame *f, int height)
Lisp_Object fullscreen;
/* Make sure we redisplay all windows in this frame. */
windows_or_buffers_changed = 60;
fset_redisplay (f);
/* Recalculate tool bar and frame text sizes. */
FRAME_TOOL_BAR_HEIGHT (f) = height;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment