]> git.eshelyaron.com Git - emacs.git/commitdiff
Cleanup frame flushing.
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 9 Sep 2013 12:15:45 +0000 (16:15 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Mon, 9 Sep 2013 12:15:45 +0000 (16:15 +0400)
* 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.

src/ChangeLog
src/dispextern.h
src/dispnew.c
src/frame.h
src/keyboard.c
src/minibuf.c
src/nsterm.m
src/w32term.c
src/xdisp.c
src/xterm.c

index 7f4c3f731f4a8ae4bd68ddaa64dde508958ee8bb..231d9771e1504a60a2c5968dcc473b39e235ad88 100644 (file)
@@ -1,3 +1,24 @@
+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.
index f15da1e6564c3e3f5eb323716169b6a4b5fbff67..67de6bffabf5dcd496b7c52d683b84227411a499 100644 (file)
@@ -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);
 
index 00abf65248c93f6e6199f6608daa6508d51d69e7..74ecfa88bde8df4330073c285d43423de43de03f 100644 (file)
@@ -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;
        }
     }
index 3dfbac15709e430e677b66997ab336ab488f1972..3d9457ce4d744f79042dd5c408bec12f469c357b 100644 (file)
@@ -1276,6 +1276,16 @@ extern void x_query_color (struct frame *f, XColor *);
 
 #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
  ***********************************************************************/
index ed70e288c8485fd29f413117a413682625fda5be..440820c57dbf25c423a1e0d5ea9726cde076ba5a 100644 (file)
@@ -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;
 }
index 7403fc6c32d8775af65253ced07f21ff5397c9ff..cc6f234f7dafa6729b4bf5795dc647bdf6d3a900 100644 (file)
@@ -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.  */
index 31053ca7a0d3ef5fee5708a5640b272de356f1c5..38d76e9389c15fdc7d313fc5de0e3326907b0444 100644 (file)
@@ -801,18 +801,6 @@ ns_update_end (struct frame *f)
   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 struct redisplay_interface ns_redisplay_interface =
   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,
index 532ded7cdada14f1d508cf6eda7f6c495bf51f77..681f70b5888cdf0daf2d3467a0a4ded57a54f447 100644 (file)
@@ -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,
index d5def0659364c1b7a02b35aab162f84d94bf643f..960ad18709bd67f09deea2496be8ca057bea34e2 100644 (file)
@@ -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 ());
 }
 
 
index 2f3d5ca7a017fa697ad11bf61376f515cfc82c7e..d12173297e827f85c8782f78e0f734196cd78435 100644 (file)
@@ -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
 }
 
 \f
@@ -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,