]> git.eshelyaron.com Git - emacs.git/commitdiff
2002-08-30 Andrew Choi <akochoi@shaw.ca>
authorAndrew Choi <akochoi@shaw.ca>
Sat, 31 Aug 2002 00:53:12 +0000 (00:53 +0000)
committerAndrew Choi <akochoi@shaw.ca>
Sat, 31 Aug 2002 00:53:12 +0000 (00:53 +0000)
* macterm.c (expose_overlaps): New function (merge code from
xterm.c).
(expose_window): Use it to fix the display of overlapping
rows (merge code from xterm.c).

src/ChangeLog
src/macterm.c

index 19b31c744665d1e65f37cc3dad6a3d14e65e2b2a..086c5463c7f5c688260c03ce21ca73a97efd76e9 100644 (file)
@@ -6,6 +6,11 @@
 
 2002-08-30  Andrew Choi  <akochoi@shaw.ca>
 
+       * macterm.c (expose_overlaps): New function (merge code from
+       xterm.c).
+       (expose_window): Use it to fix the display of overlapping
+       rows (merge code from xterm.c).
+
        * macfns.c (Qbox): Add extern declaration.
 
 2002-08-30  Juanma Barranquero  <lektu@terra.es>
index 460960e7beb48a657b60723361db94fe32121d8e..b69cdfa6c1071c6169ef4d2f8bc5fc50011192fe 100644 (file)
@@ -443,6 +443,8 @@ static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int));
 static int x_intersect_rectangles P_ ((Rect *, Rect *, Rect *));
 static void expose_frame P_ ((struct frame *, int, int, int, int));
 static int expose_window_tree P_ ((struct window *, Rect *));
+static void expose_overlaps P_ ((struct window *, struct glyph_row *,
+                                struct glyph_row *));
 static int expose_window P_ ((struct window *, Rect *));
 static void expose_area P_ ((struct window *, struct glyph_row *,
                             Rect *, enum glyph_row_area));
@@ -6240,8 +6242,41 @@ x_phys_cursor_in_rect_p (w, r)
 }
 
 
-/* Redraw the part of window W intersection rectagle FR.  Pixel
-   coordinates in FR are frame relative.  Call this function with
+/* Redraw those parts of glyphs rows during expose event handling that
+   overlap other rows.  Redrawing of an exposed line writes over parts
+   of lines overlapping that exposed line; this function fixes that.
+
+   W is the window being exposed.  FIRST_OVERLAPPING_ROW is the first
+   row in W's current matrix that is exposed and overlaps other rows.
+   LAST_OVERLAPPING_ROW is the last such row.  */
+
+static void
+expose_overlaps (w, first_overlapping_row, last_overlapping_row)
+     struct window *w;
+     struct glyph_row *first_overlapping_row;
+     struct glyph_row *last_overlapping_row;
+{
+  struct glyph_row *row;
+  
+  for (row = first_overlapping_row; row <= last_overlapping_row; ++row)
+    if (row->overlapping_p)
+      {
+       xassert (row->enabled_p && !row->mode_line_p);
+         
+       if (row->used[LEFT_MARGIN_AREA])
+         x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA);
+  
+       if (row->used[TEXT_AREA])
+         x_fix_overlapping_area (w, row, TEXT_AREA);
+  
+       if (row->used[RIGHT_MARGIN_AREA])
+         x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA);
+      }
+}
+
+
+/* Redraw the part of window W intersection rectangle FR.  Pixel
+   coordinates in FR are frame-relative.  Call this function with
    input blocked.  Value is non-zero if the exposure overwrites
    mouse-face.  */
 
@@ -6281,7 +6316,8 @@ expose_window (w, fr)
       int yb = window_text_bottom_y (w);
       struct glyph_row *row;
       int cursor_cleared_p;
-
+      struct glyph_row *first_overlapping_row, *last_overlapping_row;
+  
       TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n",
              r.left, r.top, r.right, r.bottom));
 
@@ -6301,7 +6337,8 @@ expose_window (w, fr)
       else
        cursor_cleared_p = 0;
 
-      /* Find the first row intersecting the rectangle R.  */
+      /* Update lines intersecting rectangle R.  */
+      first_overlapping_row = last_overlapping_row = NULL;
       for (row = w->current_matrix->rows;
           row->enabled_p;
           ++row)
@@ -6314,10 +6351,17 @@ expose_window (w, fr)
              || (r.top >= y0 && r.top < y1)
              || (r.bottom > y0 && r.bottom < y1))
            {
+             if (row->overlapping_p)
+               {
+                 if (first_overlapping_row == NULL)
+                   first_overlapping_row = row;
+                 last_overlapping_row = row;
+               }
+             
              if (expose_line (w, row, &r))
                mouse_face_overwritten_p = 1;
            }
-
+             
          if (y1 >= yb)
            break;
        }
@@ -6334,9 +6378,13 @@ expose_window (w, fr)
 
       if (!w->pseudo_window_p)
        {
+         /* Fix the display of overlapping rows.  */
+         if (first_overlapping_row)
+           expose_overlaps (w, first_overlapping_row, last_overlapping_row);
+         
          /* Draw border between windows.  */
          x_draw_vertical_border (w);
-
+      
          /* Turn the cursor on again.  */
          if (cursor_cleared_p)
            x_update_window_cursor (w, 1);