diff options
| author | Richard M. Stallman | 2002-07-25 03:17:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-07-25 03:17:33 +0000 |
| commit | 4f53f3b8e78b5131e5cd43bbc9e3954cfd19c710 (patch) | |
| tree | 6ddf4823e0f3f9d63f3fc7e7967383aa0c0606a2 /src | |
| parent | fc2938d180aa5f1bb9ba918173daa6c45eadf000 (diff) | |
| download | emacs-4f53f3b8e78b5131e5cd43bbc9e3954cfd19c710.tar.gz emacs-4f53f3b8e78b5131e5cd43bbc9e3954cfd19c710.zip | |
(expose_overlaps): New function.
(expose_window): Use it to fix the display of overlapping rows.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c index 151fe744193..3fbdd725c43 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -485,6 +485,8 @@ static int x_intersect_rectangles P_ ((XRectangle *, XRectangle *, | |||
| 485 | XRectangle *)); | 485 | XRectangle *)); |
| 486 | static void expose_frame P_ ((struct frame *, int, int, int, int)); | 486 | static void expose_frame P_ ((struct frame *, int, int, int, int)); |
| 487 | static int expose_window_tree P_ ((struct window *, XRectangle *)); | 487 | static int expose_window_tree P_ ((struct window *, XRectangle *)); |
| 488 | static void expose_overlaps P_ ((struct window *, struct glyph_row *, | ||
| 489 | struct glyph_row *)); | ||
| 488 | static int expose_window P_ ((struct window *, XRectangle *)); | 490 | static int expose_window P_ ((struct window *, XRectangle *)); |
| 489 | static void expose_area P_ ((struct window *, struct glyph_row *, | 491 | static void expose_area P_ ((struct window *, struct glyph_row *, |
| 490 | XRectangle *, enum glyph_row_area)); | 492 | XRectangle *, enum glyph_row_area)); |
| @@ -6070,6 +6072,39 @@ x_phys_cursor_in_rect_p (w, r) | |||
| 6070 | } | 6072 | } |
| 6071 | 6073 | ||
| 6072 | 6074 | ||
| 6075 | /* Redraw those parts of glyphs rows during expose event handling that | ||
| 6076 | overlap other rows. Redrawing of an exposed line writes over parts | ||
| 6077 | of lines overlapping that exposed line; this function fixes that. | ||
| 6078 | |||
| 6079 | W is the window being exposed. FIRST_OVERLAPPING_ROW is the first | ||
| 6080 | row in W's current matrix that is exposed and overlaps other rows. | ||
| 6081 | LAST_OVERLAPPING_ROW is the last such row. */ | ||
| 6082 | |||
| 6083 | static void | ||
| 6084 | expose_overlaps (w, first_overlapping_row, last_overlapping_row) | ||
| 6085 | struct window *w; | ||
| 6086 | struct glyph_row *first_overlapping_row; | ||
| 6087 | struct glyph_row *last_overlapping_row; | ||
| 6088 | { | ||
| 6089 | struct glyph_row *row; | ||
| 6090 | |||
| 6091 | for (row = first_overlapping_row; row <= last_overlapping_row; ++row) | ||
| 6092 | if (row->overlapping_p) | ||
| 6093 | { | ||
| 6094 | xassert (row->enabled_p && !row->mode_line_p); | ||
| 6095 | |||
| 6096 | if (row->used[LEFT_MARGIN_AREA]) | ||
| 6097 | x_fix_overlapping_area (w, row, LEFT_MARGIN_AREA); | ||
| 6098 | |||
| 6099 | if (row->used[TEXT_AREA]) | ||
| 6100 | x_fix_overlapping_area (w, row, TEXT_AREA); | ||
| 6101 | |||
| 6102 | if (row->used[RIGHT_MARGIN_AREA]) | ||
| 6103 | x_fix_overlapping_area (w, row, RIGHT_MARGIN_AREA); | ||
| 6104 | } | ||
| 6105 | } | ||
| 6106 | |||
| 6107 | |||
| 6073 | /* Redraw the part of window W intersection rectangle FR. Pixel | 6108 | /* Redraw the part of window W intersection rectangle FR. Pixel |
| 6074 | coordinates in FR are frame-relative. Call this function with | 6109 | coordinates in FR are frame-relative. Call this function with |
| 6075 | input blocked. Value is non-zero if the exposure overwrites | 6110 | input blocked. Value is non-zero if the exposure overwrites |
| @@ -6111,6 +6146,7 @@ expose_window (w, fr) | |||
| 6111 | int yb = window_text_bottom_y (w); | 6146 | int yb = window_text_bottom_y (w); |
| 6112 | struct glyph_row *row; | 6147 | struct glyph_row *row; |
| 6113 | int cursor_cleared_p; | 6148 | int cursor_cleared_p; |
| 6149 | struct glyph_row *first_overlapping_row, *last_overlapping_row; | ||
| 6114 | 6150 | ||
| 6115 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", | 6151 | TRACE ((stderr, "expose_window (%d, %d, %d, %d)\n", |
| 6116 | r.x, r.y, r.width, r.height)); | 6152 | r.x, r.y, r.width, r.height)); |
| @@ -6129,7 +6165,8 @@ expose_window (w, fr) | |||
| 6129 | else | 6165 | else |
| 6130 | cursor_cleared_p = 0; | 6166 | cursor_cleared_p = 0; |
| 6131 | 6167 | ||
| 6132 | /* Find the first row intersecting the rectangle R. */ | 6168 | /* Update lines intersecting rectangle R. */ |
| 6169 | first_overlapping_row = last_overlapping_row = NULL; | ||
| 6133 | for (row = w->current_matrix->rows; | 6170 | for (row = w->current_matrix->rows; |
| 6134 | row->enabled_p; | 6171 | row->enabled_p; |
| 6135 | ++row) | 6172 | ++row) |
| @@ -6142,6 +6179,13 @@ expose_window (w, fr) | |||
| 6142 | || (r.y >= y0 && r.y < y1) | 6179 | || (r.y >= y0 && r.y < y1) |
| 6143 | || (r.y + r.height > y0 && r.y + r.height < y1)) | 6180 | || (r.y + r.height > y0 && r.y + r.height < y1)) |
| 6144 | { | 6181 | { |
| 6182 | if (row->overlapping_p) | ||
| 6183 | { | ||
| 6184 | if (first_overlapping_row == NULL) | ||
| 6185 | first_overlapping_row = row; | ||
| 6186 | last_overlapping_row = row; | ||
| 6187 | } | ||
| 6188 | |||
| 6145 | if (expose_line (w, row, &r)) | 6189 | if (expose_line (w, row, &r)) |
| 6146 | mouse_face_overwritten_p = 1; | 6190 | mouse_face_overwritten_p = 1; |
| 6147 | } | 6191 | } |
| @@ -6162,6 +6206,10 @@ expose_window (w, fr) | |||
| 6162 | 6206 | ||
| 6163 | if (!w->pseudo_window_p) | 6207 | if (!w->pseudo_window_p) |
| 6164 | { | 6208 | { |
| 6209 | /* Fix the display of overlapping rows. */ | ||
| 6210 | if (first_overlapping_row) | ||
| 6211 | expose_overlaps (w, first_overlapping_row, last_overlapping_row); | ||
| 6212 | |||
| 6165 | /* Draw border between windows. */ | 6213 | /* Draw border between windows. */ |
| 6166 | x_draw_vertical_border (w); | 6214 | x_draw_vertical_border (w); |
| 6167 | 6215 | ||