changeset 57371:3c27c0be625d

(draw_window_fringes): Return value now indicates if any fringe bitmaps were redrawn (or there are no fringes).
author Kim F. Storm <storm@cua.dk>
date Thu, 07 Oct 2004 21:57:53 +0000
parents d370f0f6584a
children 1caa36568da6
files src/fringe.c
diffstat 1 files changed, 24 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/fringe.c	Thu Oct 07 21:57:40 2004 +0000
+++ b/src/fringe.c	Thu Oct 07 21:57:53 2004 +0000
@@ -722,19 +722,35 @@
 }
 
 /* Draw the fringes of window W.  Only fringes for rows marked for
-   update in redraw_fringe_bitmaps_p are drawn.  */
+   update in redraw_fringe_bitmaps_p are drawn.
+
+   Return >0 if left or right fringe was redrawn in any way.
+
+   If NO_FRINGE is non-zero, also return >0 if either fringe has zero width.
 
-void
-draw_window_fringes (w)
+   A return value >0 indicates that the vertical line between windows
+   needs update (as it may be drawn in the fringe).
+*/
+
+int
+draw_window_fringes (w, no_fringe)
      struct window *w;
+     int no_fringe;
 {
   struct glyph_row *row;
   int yb = window_text_bottom_y (w);
   int nrows = w->current_matrix->nrows;
   int y = 0, rn;
+  int updated = 0;
 
   if (w->pseudo_window_p)
-    return;
+    return 0;
+
+  /* Must draw line if no fringe */
+  if (no_fringe
+      && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
+	  || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
+    updated++;
 
   for (y = 0, rn = 0, row = w->current_matrix->rows;
        y < yb && rn < nrows;
@@ -744,7 +760,10 @@
 	continue;
       draw_row_fringe_bitmaps (w, row);
       row->redraw_fringe_bitmaps_p = 0;
+      updated++;
     }
+
+  return updated;
 }
 
 
@@ -950,11 +969,7 @@
    Typically, we add an equal amount (+/- 1 pixel) to each fringe,
    but a negative width value is taken literally (after negating it).
 
-   We never make the fringes narrower than specified.  It is planned
-   to make fringe bitmaps customizable and expandable, and at that
-   time, the user will typically specify the minimum number of pixels
-   needed for his bitmaps, so we shouldn't select anything less than
-   what is specified.
+   We never make the fringes narrower than specified.
 */
 
 void