comparison src/xterm.c @ 42374:0f5f05b4b9c0

(notice_overwritten_cursor): Don't depend on output_cursor and updated_area. Compare pixel coordinates with window's cursor pixel coordinates. (x_draw_glyphs, x_clear_end_of_line, show_mouse_face): Call notice_overwritten_cursor with new arg list. (show_mouse_face): Fix bug setting a row's mouse_face_p flag unconditionally.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 28 Dec 2001 13:33:37 +0000
parents 0f4506820432
children 0f408d016a15
comparison
equal deleted inserted replaced
42373:d42021971160 42374:0f5f05b4b9c0
474 474
475 static void x_clip_to_row P_ ((struct window *, struct glyph_row *, 475 static void x_clip_to_row P_ ((struct window *, struct glyph_row *,
476 GC, int)); 476 GC, int));
477 static int x_phys_cursor_in_rect_p P_ ((struct window *, XRectangle *)); 477 static int x_phys_cursor_in_rect_p P_ ((struct window *, XRectangle *));
478 static void x_draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); 478 static void x_draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
479 static void notice_overwritten_cursor P_ ((struct window *, int, int)); 479 static void notice_overwritten_cursor P_ ((struct window *, enum glyph_row_area,
480 int, int, int, int));
480 static void x_flush P_ ((struct frame *f)); 481 static void x_flush P_ ((struct frame *f));
481 static void x_update_begin P_ ((struct frame *)); 482 static void x_update_begin P_ ((struct frame *));
482 static void x_update_window_begin P_ ((struct window *)); 483 static void x_update_window_begin P_ ((struct window *));
483 static void x_draw_vertical_border P_ ((struct window *)); 484 static void x_draw_vertical_border P_ ((struct window *));
484 static void x_after_update_window_line P_ ((struct glyph_row *)); 485 static void x_after_update_window_line P_ ((struct glyph_row *));
5205 int left_area_width = window_box_width (w, LEFT_MARGIN_AREA); 5206 int left_area_width = window_box_width (w, LEFT_MARGIN_AREA);
5206 x0 -= left_area_width; 5207 x0 -= left_area_width;
5207 x1 -= left_area_width; 5208 x1 -= left_area_width;
5208 } 5209 }
5209 5210
5210 notice_overwritten_cursor (w, x0, x1); 5211 notice_overwritten_cursor (w, area, x0, x1,
5212 row->y, MATRIX_ROW_BOTTOM_Y (row));
5211 } 5213 }
5212 5214
5213 /* Value is the x-position up to which drawn, relative to AREA of W. 5215 /* Value is the x-position up to which drawn, relative to AREA of W.
5214 This doesn't include parts drawn because of overhangs. */ 5216 This doesn't include parts drawn because of overhangs. */
5215 x_reached = FRAME_TO_WINDOW_PIXEL_X (w, x_reached); 5217 x_reached = FRAME_TO_WINDOW_PIXEL_X (w, x_reached);
5427 5429
5428 to_y = min (max_y, output_cursor.y + updated_row->height); 5430 to_y = min (max_y, output_cursor.y + updated_row->height);
5429 5431
5430 /* Notice if the cursor will be cleared by this operation. */ 5432 /* Notice if the cursor will be cleared by this operation. */
5431 if (!updated_row->full_width_p) 5433 if (!updated_row->full_width_p)
5432 notice_overwritten_cursor (w, output_cursor.x, -1); 5434 notice_overwritten_cursor (w, updated_area,
5435 output_cursor.x, -1,
5436 updated_row->y,
5437 MATRIX_ROW_BOTTOM_Y (updated_row));
5433 5438
5434 from_x = output_cursor.x; 5439 from_x = output_cursor.x;
5435 5440
5436 /* Translate to frame coordinates. */ 5441 /* Translate to frame coordinates. */
5437 if (updated_row->full_width_p) 5442 if (updated_row->full_width_p)
7778 if (end_hpos > start_hpos) 7783 if (end_hpos > start_hpos)
7779 { 7784 {
7780 x_draw_glyphs (w, start_x, row, TEXT_AREA, 7785 x_draw_glyphs (w, start_x, row, TEXT_AREA,
7781 start_hpos, end_hpos, draw, 0); 7786 start_hpos, end_hpos, draw, 0);
7782 7787
7783 row->mouse_face_p = draw == DRAW_MOUSE_FACE || DRAW_IMAGE_RAISED; 7788 row->mouse_face_p
7789 = draw == DRAW_MOUSE_FACE || draw == DRAW_IMAGE_RAISED;
7784 } 7790 }
7785 } 7791 }
7786 7792
7787 /* When we've written over the cursor, arrange for it to 7793 /* When we've written over the cursor, arrange for it to
7788 be displayed again. */ 7794 be displayed again. */
11096 11102
11097 /*********************************************************************** 11103 /***********************************************************************
11098 Text Cursor 11104 Text Cursor
11099 ***********************************************************************/ 11105 ***********************************************************************/
11100 11106
11101 /* Notice if the text cursor of window W has been overwritten by a 11107 /* Notice when the text cursor of window W has been completely
11102 drawing operation that outputs N glyphs starting at START_X and 11108 overwritten by a drawing operation that outputs glyphs in AREA
11103 ending at END_X in the line given by output_cursor.vpos. 11109 starting at X0 and ending at X1 in the line starting at Y0 and
11104 Coordinates are area-relative. END_X < 0 means all the rest 11110 ending at Y1. X coordinates are area-relative. X1 < 0 means all
11105 of the line after START_X has been written. */ 11111 the rest of the line after X0 has been written. Y coordinates
11112 are window-relative. */
11106 11113
11107 static void 11114 static void
11108 notice_overwritten_cursor (w, start_x, end_x) 11115 notice_overwritten_cursor (w, area, x0, x1, y0, y1)
11109 struct window *w; 11116 struct window *w;
11110 int start_x, end_x; 11117 enum glyph_row_area area;
11111 { 11118 int x0, y0, x1, y1;
11112 if (updated_area == TEXT_AREA 11119 {
11120 if (area == TEXT_AREA
11113 && w->phys_cursor_on_p 11121 && w->phys_cursor_on_p
11114 && output_cursor.vpos == w->phys_cursor.vpos 11122 && y0 <= w->phys_cursor.y
11115 && start_x <= w->phys_cursor.x 11123 && y1 >= w->phys_cursor.y + w->phys_cursor_height
11116 && (end_x < 0 || end_x > w->phys_cursor.x)) 11124 && x0 <= w->phys_cursor.x
11125 && (x1 < 0 || x1 > w->phys_cursor.x))
11117 w->phys_cursor_on_p = 0; 11126 w->phys_cursor_on_p = 0;
11118 } 11127 }
11119 11128
11120 11129
11121 /* Set clipping for output in glyph row ROW. W is the window in which 11130 /* Set clipping for output in glyph row ROW. W is the window in which