summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-11-28 17:43:09 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2013-11-28 17:43:09 -0500
commit655ab9a380068143cfb9a31d01488e83676d81c1 (patch)
treec703f4b96ca26edb6200cd08d6415fb6ece04560 /src/frame.c
parent698c0f24f170025470f3dcda51c11290062d78c4 (diff)
Refine redisplay optimizations to only redisplay *some* frames/windows
rather than all of them. * src/xdisp.c (REDISPLAY_SOME): New constant. (redisplay_other_windows, wset_redisplay, fset_redisplay) (bset_redisplay, bset_update_mode_line): New functions. (message_dolog): Use bset_redisplay. (clear_garbaged_frames): Use fset_redisplay. (echo_area_display): Use wset_redisplay. (buffer_shared_and_changed): Remove. (prepare_menu_bars): Call Vpre_redisplay_function before updating frame titles. Compute the actual set of windows redisplayed. Don't update frame titles and menu bars for frames that don't need to be redisplayed. (propagate_buffer_redisplay): New function. (AINC): New macro. (redisplay_internal): Use it. Be more selective in the set of windows we redisplay. Propagate windows_or_buffers_changed to update_mode_lines a bit later to simplify the code. (mark_window_display_accurate_1): Reset window and buffer's `redisplay' flag. (redisplay_window): Do nothing if neither the window nor the buffer nor the frame needs redisplay. * src/window.h (struct window): Add `redisplay' field. (wset_redisplay, fset_redisplay, bset_redisplay, bset_update_mode_line) (redisplay_other_windows, window_list): New declarations. * src/window.c (select_window, Fset_window_start): Use wset_redisplay. (window_list): Not static any more. (grow_mini_window, shrink_mini_window): Use fset_redisplay. * src/minibuf.c (read_minibuf_unwind): Don't redisplay everything. * src/insdel.c (prepare_to_modify_buffer_1): Use bset_redisplay. * src/frame.c (Fmake_frame_visible): Don't redisplay everything. * src/frame.h (struct frame): Add `redisplay' field. Move `external_menu_bar' bitfield next to other bit-fields. (SET_FRAME_GARBAGED): Use fset_redisplay. (SET_FRAME_VISIBLE): Don't garbage the frame; Use redisplay_other_windows. * src/buffer.h (struct buffer): Add `redisplay' field. * src/buffer.c (Fforce_mode_line_update): Pay attention to the `all' flag. (modify_overlay): Use bset_redisplay. * src/alloc.c (gc_sweep): Don't unmark strings while sweeping symbols. * lisp/doc-view.el (doc-view-goto-page): Update mode-line.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/frame.c b/src/frame.c
index 84293e27d0..35e7ff1fbb 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -339,11 +339,12 @@ make_frame (bool mini_p)
non-Lisp data, so do it only for slots which should not be zero.
To avoid subtle bugs and for the sake of readability, it's better to
initialize enum members explicitly even if their values are zero. */
- f->wants_modeline = 1;
- f->garbaged = 1;
+ f->wants_modeline = true;
+ f->redisplay = true;
+ f->garbaged = true;
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
- f->column_width = 1; /* !FRAME_WINDOW_P value */
- f->line_height = 1; /* !FRAME_WINDOW_P value */
+ f->column_width = 1; /* !FRAME_WINDOW_P value. */
+ f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
f->want_fullscreen = FULLSCREEN_NONE;
#endif
@@ -785,9 +786,6 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
if (sf == XFRAME (frame))
return frame;
- /* This is too greedy; it causes inappropriate focus redirection
- that's hard to get rid of. */
-#if 0
/* If a frame's focus has been redirected toward the currently
selected frame, we should change the redirection to point to the
newly selected frame. This means that if the focus is redirected
@@ -795,6 +793,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
can use `other-window' to switch between all the frames using
that minibuffer frame, and the focus redirection will follow us
around. */
+#if 0
+ /* This is too greedy; it causes inappropriate focus redirection
+ that's hard to get rid of. */
if (track)
{
Lisp_Object tail;
@@ -1681,7 +1682,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
make_frame_visible_1 (f->root_window);
/* Make menu bar update for the Buffers and Frames menus. */
- windows_or_buffers_changed = 15;
+ /* windows_or_buffers_changed = 15; FIXME: Why? */
XSETFRAME (frame, f);
return frame;