+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.
/* 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);
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;
}
}
#endif /* HAVE_WINDOW_SYSTEM */
\f
+
+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
***********************************************************************/
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;
}
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. */
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)
/* --------------------------------------------------------------------------
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,
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 =
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,
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);
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 ());
}
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 ();
}
#endif
}
-#ifndef XFlush
XFlush (FRAME_X_DISPLAY (f));
-#endif
}
\f
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,