Commit fd462129 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

Cleanup frame flushing.

* dispextern.h (struct redisplay_interface): Drop
flush_display_optional because flush_display is enough
for X and flushing via RIF is just a no-op for others.
* frame.h (flush_frame): New function.
* dispnew.c (update_frame):
* minibuf.c (read_minibuf):
* xdisp.c (echo_area_display, redisplay_preserve_echo_area):
Use it.
* keyboard.c (detect_input_pending_run_timers): Do not flush
all frames but selected one in redisplay_preserve_echo_area.
* nsterm.m (ns_flush): Remove no-op.
(ns_redisplay_interface): Adjust user.
* w32term.h (x_flush): Remove no-op.
(w32_redisplay_interface): Adjust user.
* xterm.c (x_flush): Simplify because we do not flush all
frames at once any more.  Adjust comment.
(x_redisplay_interface): Adjust user.
parent 992ec28a
2013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
Cleanup frame flushing.
* dispextern.h (struct redisplay_interface): Drop
flush_display_optional because flush_display is enough
for X and flushing via RIF is just a no-op for others.
* frame.h (flush_frame): New function.
* dispnew.c (update_frame):
* minibuf.c (read_minibuf):
* xdisp.c (echo_area_display, redisplay_preserve_echo_area):
Use it.
* keyboard.c (detect_input_pending_run_timers): Do not flush
all frames but selected one in redisplay_preserve_echo_area.
* nsterm.m (ns_flush): Remove no-op.
(ns_redisplay_interface): Adjust user.
* w32term.h (x_flush): Remove no-op.
(w32_redisplay_interface): Adjust user.
* xterm.c (x_flush): Simplify because we do not flush all
frames at once any more. Adjust comment.
(x_redisplay_interface): Adjust user.
2013-09-07 Paul Eggert <eggert@cs.ucla.edu>
Port --without-x --enable-gcc-warnings to Fedora 19.
......
......@@ -2796,11 +2796,6 @@ struct redisplay_interface
/* Flush the display of frame F. For X, this is XFlush. */
void (*flush_display) (struct frame *f);
/* Flush the display of frame F if non-NULL. This is called
during redisplay, and should be NULL on systems which flush
automatically before reading input. */
void (*flush_display_optional) (struct frame *f);
/* Clear the mouse highlight in window W, if there is any. */
void (*clear_window_mouse_face) (struct window *w);
......
......@@ -3068,7 +3068,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
at least the fringes are not redrawn in a timely manner. ++kfs */
if (f->force_flush_display_p)
{
FRAME_RIF (f)->flush_display (f);
flush_frame (f);
f->force_flush_display_p = 0;
}
}
......
......@@ -1276,6 +1276,16 @@ extern void x_query_color (struct frame *f, XColor *);
#endif /* HAVE_WINDOW_SYSTEM */
FRAME_INLINE void
flush_frame (struct frame *f)
{
struct redisplay_interface *rif = FRAME_RIF (f);
if (rif && rif->flush_display)
rif->flush_display (f);
}
/***********************************************************************
Multimonitor data
***********************************************************************/
......
......@@ -9873,20 +9873,7 @@ detect_input_pending_run_timers (bool do_display)
get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
if (old_timers_run != timers_run && do_display)
{
redisplay_preserve_echo_area (8);
/* The following fixes a bug when using lazy-lock with
lazy-lock-defer-on-the-fly set to t, i.e. when fontifying
from an idle timer function. The symptom of the bug is that
the cursor sometimes doesn't become visible until the next X
event is processed. --gerd. */
{
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, frame)
if (FRAME_RIF (XFRAME (frame)))
FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame));
}
}
redisplay_preserve_echo_area (8);
return input_pending;
}
......
......@@ -672,12 +672,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
XWINDOW (minibuf_window)->cursor.x = 0;
XWINDOW (minibuf_window)->must_be_updated_p = 1;
update_frame (XFRAME (selected_frame), 1, 1);
{
struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
struct redisplay_interface *rif = FRAME_RIF (f);
if (rif && rif->flush_display)
rif->flush_display (f);
}
flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
}
/* Make minibuffer contents into a string. */
......
......@@ -801,18 +801,6 @@ Free a pool and temporary objects it refers to (callable from C)
NSTRACE (ns_update_end);
}
static void
ns_flush (struct frame *f)
/* --------------------------------------------------------------------------
external (RIF) call
NS impl is no-op since currently we flush in ns_update_end and elsewhere
-------------------------------------------------------------------------- */
{
NSTRACE (ns_flush);
}
static void
ns_focus (struct frame *f, NSRect *r, int n)
/* --------------------------------------------------------------------------
......@@ -3963,8 +3951,7 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
ns_after_update_window_line,
ns_update_window_begin,
ns_update_window_end,
ns_flush,
0, /* flush_display_optional */
0, /* flush_display */
x_clear_window_mouse_face,
x_get_glyph_overhangs,
x_fix_overlapping_area,
......
......@@ -6258,11 +6258,6 @@ w32_make_rdb (char *xrm_option)
return buffer;
}
void
x_flush (struct frame * f)
{ /* Nothing to do */ }
extern frame_parm_handler w32_frame_parm_handlers[];
static struct redisplay_interface w32_redisplay_interface =
......@@ -6276,8 +6271,7 @@ static struct redisplay_interface w32_redisplay_interface =
x_after_update_window_line,
x_update_window_begin,
x_update_window_end,
x_flush,
0, /* flush_display_optional */
0, /* flush_display */
x_clear_window_mouse_face,
x_get_glyph_overhangs,
x_fix_overlapping_area,
......
......@@ -10859,7 +10859,7 @@ echo_area_display (int update_frame_p)
Can do with a display update of the echo area,
unless we displayed some mode lines. */
update_single_window (w, 1);
FRAME_RIF (f)->flush_display (f);
flush_frame (f);
}
else
update_frame (f, 1, 1);
......@@ -13645,9 +13645,7 @@ redisplay_preserve_echo_area (int from_where)
else
redisplay_internal ();
 
if (FRAME_RIF (SELECTED_FRAME ()) != NULL
&& FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
flush_frame (SELECTED_FRAME ());
}
 
 
......
......@@ -334,29 +334,19 @@ static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t);
static void x_initialize (void);
/* Flush display of frame F, or of all frames if F is null. */
/* Flush display of frame F. */
static void
x_flush (struct frame *f)
{
eassert (f && FRAME_X_P (f));
/* Don't call XFlush when it is not safe to redisplay; the X
connection may be broken. */
if (!NILP (Vinhibit_redisplay))
return;
block_input ();
if (f)
{
eassert (FRAME_X_P (f));
XFlush (FRAME_X_DISPLAY (f));
}
else
{
/* Flush all displays and so all frames on them. */
struct x_display_info *xdi;
for (xdi = x_display_list; xdi; xdi = xdi->next)
XFlush (xdi->display);
}
XFlush (FRAME_X_DISPLAY (f));
unblock_input ();
}
......@@ -7361,9 +7351,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
#endif
}
#ifndef XFlush
XFlush (FRAME_X_DISPLAY (f));
#endif
}
......@@ -10384,11 +10372,6 @@ static struct redisplay_interface x_redisplay_interface =
x_update_window_begin,
x_update_window_end,
x_flush,
#ifdef XFlush
x_flush,
#else
0, /* flush_display_optional */
#endif
x_clear_window_mouse_face,
x_get_glyph_overhangs,
x_fix_overlapping_area,
......
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