changeset 91023:cb5edf67e2f2

(get_glyph_string_clip_rects): Reflect s->row->clip to the resulting clip(s}. (expose_overlaps): Add arg r. Callers changed. Set it ot row->clip temporarily. (expose_window): Redraw rows overlapping the exposed area.
author Kenichi Handa <handa@m17n.org>
date Thu, 13 Sep 2007 10:49:33 +0000
parents 7e1dd3878c0b
children b1f535db3dca
files src/xdisp.c
diffstat 1 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Thu Sep 13 10:46:21 2007 +0000
+++ b/src/xdisp.c	Thu Sep 13 10:49:33 2007 +0000
@@ -1945,6 +1945,14 @@
 	}
     }
 
+  if (s->row->clip)
+    {
+      XRectangle r_save = r;
+
+      if (! x_intersect_rectangles (&r_save, s->row->clip, &r))
+	r.width = 0;
+    }
+
   if ((s->for_overlaps & OVERLAPS_BOTH) == 0
       || ((s->for_overlaps & OVERLAPS_BOTH) == OVERLAPS_BOTH && n == 1))
     {
@@ -23698,10 +23706,11 @@
    LAST_OVERLAPPING_ROW is the last such row.  */
 
 static void
-expose_overlaps (w, first_overlapping_row, last_overlapping_row)
+expose_overlaps (w, first_overlapping_row, last_overlapping_row, r)
      struct window *w;
      struct glyph_row *first_overlapping_row;
      struct glyph_row *last_overlapping_row;
+     XRectangle *r;
 {
   struct glyph_row *row;
 
@@ -23710,6 +23719,7 @@
       {
 	xassert (row->enabled_p && !row->mode_line_p);
 
+	row->clip = r;
 	if (row->used[LEFT_MARGIN_AREA])
 	  x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA, OVERLAPS_BOTH);
 
@@ -23718,6 +23728,7 @@
 
 	if (row->used[RIGHT_MARGIN_AREA])
 	  x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA, OVERLAPS_BOTH);
+	row->clip = NULL;
       }
 }
 
@@ -23881,8 +23892,22 @@
 		  last_overlapping_row = row;
 		}
 
+	      row->clip = fr;
 	      if (expose_line (w, row, &r))
 		mouse_face_overwritten_p = 1;
+	      row->clip = NULL;
+	    }
+	  else if (row->overlapping_p)
+	    {
+	      /* We must redraw a row overlapping the exposed area.  */
+	      if (y0 < r.y
+		  ? y0 + row->phys_height > r.y
+		  : y0 + row->ascent - row->phys_ascent < r.y +r.height)
+		{
+		  if (first_overlapping_row == NULL)
+		    first_overlapping_row = row;
+		  last_overlapping_row = row;
+		}
 	    }
 
 	  if (y1 >= yb)
@@ -23903,7 +23928,8 @@
 	{
 	  /* Fix the display of overlapping rows.  */
 	  if (first_overlapping_row)
-	    expose_overlaps (w, first_overlapping_row, last_overlapping_row);
+	    expose_overlaps (w, first_overlapping_row, last_overlapping_row,
+			     fr);
 
 	  /* Draw border between windows.  */
 	  x_draw_vertical_border (w);