aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-09 16:15:45 +0400
committerDmitry Antipov2013-09-09 16:15:45 +0400
commitfd462129af606e37146cad265284ff4097051ad8 (patch)
tree9e7774cf6fa5228da2b148db6d2a6b4f0e480d35 /src
parent992ec28ae836a2954f6f24ce49b4fba0cde1bf7d (diff)
downloademacs-fd462129af606e37146cad265284ff4097051ad8.tar.gz
emacs-fd462129af606e37146cad265284ff4097051ad8.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/dispextern.h5
-rw-r--r--src/dispnew.c2
-rw-r--r--src/frame.h10
-rw-r--r--src/keyboard.c15
-rw-r--r--src/minibuf.c7
-rw-r--r--src/nsterm.m15
-rw-r--r--src/w32term.c8
-rw-r--r--src/xdisp.c6
-rw-r--r--src/xterm.c23
10 files changed, 41 insertions, 71 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7f4c3f731f4..231d9771e15 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Cleanup frame flushing.
4 * dispextern.h (struct redisplay_interface): Drop
5 flush_display_optional because flush_display is enough
6 for X and flushing via RIF is just a no-op for others.
7 * frame.h (flush_frame): New function.
8 * dispnew.c (update_frame):
9 * minibuf.c (read_minibuf):
10 * xdisp.c (echo_area_display, redisplay_preserve_echo_area):
11 Use it.
12 * keyboard.c (detect_input_pending_run_timers): Do not flush
13 all frames but selected one in redisplay_preserve_echo_area.
14 * nsterm.m (ns_flush): Remove no-op.
15 (ns_redisplay_interface): Adjust user.
16 * w32term.h (x_flush): Remove no-op.
17 (w32_redisplay_interface): Adjust user.
18 * xterm.c (x_flush): Simplify because we do not flush all
19 frames at once any more. Adjust comment.
20 (x_redisplay_interface): Adjust user.
21
12013-09-07 Paul Eggert <eggert@cs.ucla.edu> 222013-09-07 Paul Eggert <eggert@cs.ucla.edu>
2 23
3 Port --without-x --enable-gcc-warnings to Fedora 19. 24 Port --without-x --enable-gcc-warnings to Fedora 19.
diff --git a/src/dispextern.h b/src/dispextern.h
index f15da1e6564..67de6bffabf 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2796,11 +2796,6 @@ struct redisplay_interface
2796 /* Flush the display of frame F. For X, this is XFlush. */ 2796 /* Flush the display of frame F. For X, this is XFlush. */
2797 void (*flush_display) (struct frame *f); 2797 void (*flush_display) (struct frame *f);
2798 2798
2799 /* Flush the display of frame F if non-NULL. This is called
2800 during redisplay, and should be NULL on systems which flush
2801 automatically before reading input. */
2802 void (*flush_display_optional) (struct frame *f);
2803
2804 /* Clear the mouse highlight in window W, if there is any. */ 2799 /* Clear the mouse highlight in window W, if there is any. */
2805 void (*clear_window_mouse_face) (struct window *w); 2800 void (*clear_window_mouse_face) (struct window *w);
2806 2801
diff --git a/src/dispnew.c b/src/dispnew.c
index 00abf65248c..74ecfa88bde 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3068,7 +3068,7 @@ update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p)
3068 at least the fringes are not redrawn in a timely manner. ++kfs */ 3068 at least the fringes are not redrawn in a timely manner. ++kfs */
3069 if (f->force_flush_display_p) 3069 if (f->force_flush_display_p)
3070 { 3070 {
3071 FRAME_RIF (f)->flush_display (f); 3071 flush_frame (f);
3072 f->force_flush_display_p = 0; 3072 f->force_flush_display_p = 0;
3073 } 3073 }
3074 } 3074 }
diff --git a/src/frame.h b/src/frame.h
index 3dfbac15709..3d9457ce4d7 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1276,6 +1276,16 @@ extern void x_query_color (struct frame *f, XColor *);
1276 1276
1277#endif /* HAVE_WINDOW_SYSTEM */ 1277#endif /* HAVE_WINDOW_SYSTEM */
1278 1278
1279
1280FRAME_INLINE void
1281flush_frame (struct frame *f)
1282{
1283 struct redisplay_interface *rif = FRAME_RIF (f);
1284
1285 if (rif && rif->flush_display)
1286 rif->flush_display (f);
1287}
1288
1279/*********************************************************************** 1289/***********************************************************************
1280 Multimonitor data 1290 Multimonitor data
1281 ***********************************************************************/ 1291 ***********************************************************************/
diff --git a/src/keyboard.c b/src/keyboard.c
index ed70e288c84..440820c57db 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9873,20 +9873,7 @@ detect_input_pending_run_timers (bool do_display)
9873 get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW); 9873 get_input_pending (READABLE_EVENTS_DO_TIMERS_NOW);
9874 9874
9875 if (old_timers_run != timers_run && do_display) 9875 if (old_timers_run != timers_run && do_display)
9876 { 9876 redisplay_preserve_echo_area (8);
9877 redisplay_preserve_echo_area (8);
9878 /* The following fixes a bug when using lazy-lock with
9879 lazy-lock-defer-on-the-fly set to t, i.e. when fontifying
9880 from an idle timer function. The symptom of the bug is that
9881 the cursor sometimes doesn't become visible until the next X
9882 event is processed. --gerd. */
9883 {
9884 Lisp_Object tail, frame;
9885 FOR_EACH_FRAME (tail, frame)
9886 if (FRAME_RIF (XFRAME (frame)))
9887 FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame));
9888 }
9889 }
9890 9877
9891 return input_pending; 9878 return input_pending;
9892} 9879}
diff --git a/src/minibuf.c b/src/minibuf.c
index 7403fc6c32d..cc6f234f7da 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -672,12 +672,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
672 XWINDOW (minibuf_window)->cursor.x = 0; 672 XWINDOW (minibuf_window)->cursor.x = 0;
673 XWINDOW (minibuf_window)->must_be_updated_p = 1; 673 XWINDOW (minibuf_window)->must_be_updated_p = 1;
674 update_frame (XFRAME (selected_frame), 1, 1); 674 update_frame (XFRAME (selected_frame), 1, 1);
675 { 675 flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
676 struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
677 struct redisplay_interface *rif = FRAME_RIF (f);
678 if (rif && rif->flush_display)
679 rif->flush_display (f);
680 }
681 } 676 }
682 677
683 /* Make minibuffer contents into a string. */ 678 /* Make minibuffer contents into a string. */
diff --git a/src/nsterm.m b/src/nsterm.m
index 31053ca7a0d..38d76e9389c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -801,18 +801,6 @@ ns_update_end (struct frame *f)
801 NSTRACE (ns_update_end); 801 NSTRACE (ns_update_end);
802} 802}
803 803
804
805static void
806ns_flush (struct frame *f)
807/* --------------------------------------------------------------------------
808 external (RIF) call
809 NS impl is no-op since currently we flush in ns_update_end and elsewhere
810 -------------------------------------------------------------------------- */
811{
812 NSTRACE (ns_flush);
813}
814
815
816static void 804static void
817ns_focus (struct frame *f, NSRect *r, int n) 805ns_focus (struct frame *f, NSRect *r, int n)
818/* -------------------------------------------------------------------------- 806/* --------------------------------------------------------------------------
@@ -3963,8 +3951,7 @@ static struct redisplay_interface ns_redisplay_interface =
3963 ns_after_update_window_line, 3951 ns_after_update_window_line,
3964 ns_update_window_begin, 3952 ns_update_window_begin,
3965 ns_update_window_end, 3953 ns_update_window_end,
3966 ns_flush, 3954 0, /* flush_display */
3967 0, /* flush_display_optional */
3968 x_clear_window_mouse_face, 3955 x_clear_window_mouse_face,
3969 x_get_glyph_overhangs, 3956 x_get_glyph_overhangs,
3970 x_fix_overlapping_area, 3957 x_fix_overlapping_area,
diff --git a/src/w32term.c b/src/w32term.c
index 532ded7cdad..681f70b5888 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6258,11 +6258,6 @@ w32_make_rdb (char *xrm_option)
6258 return buffer; 6258 return buffer;
6259} 6259}
6260 6260
6261void
6262x_flush (struct frame * f)
6263{ /* Nothing to do */ }
6264
6265
6266extern frame_parm_handler w32_frame_parm_handlers[]; 6261extern frame_parm_handler w32_frame_parm_handlers[];
6267 6262
6268static struct redisplay_interface w32_redisplay_interface = 6263static struct redisplay_interface w32_redisplay_interface =
@@ -6276,8 +6271,7 @@ static struct redisplay_interface w32_redisplay_interface =
6276 x_after_update_window_line, 6271 x_after_update_window_line,
6277 x_update_window_begin, 6272 x_update_window_begin,
6278 x_update_window_end, 6273 x_update_window_end,
6279 x_flush, 6274 0, /* flush_display */
6280 0, /* flush_display_optional */
6281 x_clear_window_mouse_face, 6275 x_clear_window_mouse_face,
6282 x_get_glyph_overhangs, 6276 x_get_glyph_overhangs,
6283 x_fix_overlapping_area, 6277 x_fix_overlapping_area,
diff --git a/src/xdisp.c b/src/xdisp.c
index d5def065936..960ad18709b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10859,7 +10859,7 @@ echo_area_display (int update_frame_p)
10859 Can do with a display update of the echo area, 10859 Can do with a display update of the echo area,
10860 unless we displayed some mode lines. */ 10860 unless we displayed some mode lines. */
10861 update_single_window (w, 1); 10861 update_single_window (w, 1);
10862 FRAME_RIF (f)->flush_display (f); 10862 flush_frame (f);
10863 } 10863 }
10864 else 10864 else
10865 update_frame (f, 1, 1); 10865 update_frame (f, 1, 1);
@@ -13645,9 +13645,7 @@ redisplay_preserve_echo_area (int from_where)
13645 else 13645 else
13646 redisplay_internal (); 13646 redisplay_internal ();
13647 13647
13648 if (FRAME_RIF (SELECTED_FRAME ()) != NULL 13648 flush_frame (SELECTED_FRAME ());
13649 && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
13650 FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
13651} 13649}
13652 13650
13653 13651
diff --git a/src/xterm.c b/src/xterm.c
index 2f3d5ca7a01..d12173297e8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -334,29 +334,19 @@ static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t);
334static void x_initialize (void); 334static void x_initialize (void);
335 335
336 336
337/* Flush display of frame F, or of all frames if F is null. */ 337/* Flush display of frame F. */
338 338
339static void 339static void
340x_flush (struct frame *f) 340x_flush (struct frame *f)
341{ 341{
342 eassert (f && FRAME_X_P (f));
342 /* Don't call XFlush when it is not safe to redisplay; the X 343 /* Don't call XFlush when it is not safe to redisplay; the X
343 connection may be broken. */ 344 connection may be broken. */
344 if (!NILP (Vinhibit_redisplay)) 345 if (!NILP (Vinhibit_redisplay))
345 return; 346 return;
346 347
347 block_input (); 348 block_input ();
348 if (f) 349 XFlush (FRAME_X_DISPLAY (f));
349 {
350 eassert (FRAME_X_P (f));
351 XFlush (FRAME_X_DISPLAY (f));
352 }
353 else
354 {
355 /* Flush all displays and so all frames on them. */
356 struct x_display_info *xdi;
357 for (xdi = x_display_list; xdi; xdi = xdi->next)
358 XFlush (xdi->display);
359 }
360 unblock_input (); 350 unblock_input ();
361} 351}
362 352
@@ -7361,9 +7351,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
7361#endif 7351#endif
7362 } 7352 }
7363 7353
7364#ifndef XFlush
7365 XFlush (FRAME_X_DISPLAY (f)); 7354 XFlush (FRAME_X_DISPLAY (f));
7366#endif
7367} 7355}
7368 7356
7369 7357
@@ -10384,11 +10372,6 @@ static struct redisplay_interface x_redisplay_interface =
10384 x_update_window_begin, 10372 x_update_window_begin,
10385 x_update_window_end, 10373 x_update_window_end,
10386 x_flush, 10374 x_flush,
10387#ifdef XFlush
10388 x_flush,
10389#else
10390 0, /* flush_display_optional */
10391#endif
10392 x_clear_window_mouse_face, 10375 x_clear_window_mouse_face,
10393 x_get_glyph_overhangs, 10376 x_get_glyph_overhangs,
10394 x_fix_overlapping_area, 10377 x_fix_overlapping_area,