aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2006-05-27 22:36:58 +0000
committerKim F. Storm2006-05-27 22:36:58 +0000
commitf5080b2277726e794384955acb7fd39d845d01df (patch)
tree8da8b84b0aa442ae8076f0ad1037071f6e7ca5bc
parent26837cd3eabe734e6e077a73e5cb6e0844302203 (diff)
downloademacs-f5080b2277726e794384955acb7fd39d845d01df.tar.gz
emacs-f5080b2277726e794384955acb7fd39d845d01df.zip
(get_phys_cursor_geometry): Return computed x and y through
parameters. Adjust x and width in case cursor in on a partially visible stretch glyph on the left edge. (erase_phys_cursor): Don't erase into left fringe/margin in case previous cursor glyph is a partially visible stretch glyph on left.
-rw-r--r--src/xdisp.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index d74b6d04aa5..6ebc64bf9f5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1986,15 +1986,15 @@ get_glyph_string_clip_rect (s, nr)
1986 Set w->phys_cursor_width to width of phys cursor. 1986 Set w->phys_cursor_width to width of phys cursor.
1987*/ 1987*/
1988 1988
1989int 1989void
1990get_phys_cursor_geometry (w, row, glyph, heightp) 1990get_phys_cursor_geometry (w, row, glyph, xp, yp, heightp)
1991 struct window *w; 1991 struct window *w;
1992 struct glyph_row *row; 1992 struct glyph_row *row;
1993 struct glyph *glyph; 1993 struct glyph *glyph;
1994 int *heightp; 1994 int *xp, *yp, *heightp;
1995{ 1995{
1996 struct frame *f = XFRAME (WINDOW_FRAME (w)); 1996 struct frame *f = XFRAME (WINDOW_FRAME (w));
1997 int y, wd, h, h0, y0; 1997 int x, y, wd, h, h0, y0;
1998 1998
1999 /* Compute the width of the rectangle to draw. If on a stretch 1999 /* Compute the width of the rectangle to draw. If on a stretch
2000 glyph, and `x-stretch-block-cursor' is nil, don't draw a 2000 glyph, and `x-stretch-block-cursor' is nil, don't draw a
@@ -2004,6 +2004,14 @@ get_phys_cursor_geometry (w, row, glyph, heightp)
2004#ifdef HAVE_NTGUI 2004#ifdef HAVE_NTGUI
2005 wd++; /* Why? */ 2005 wd++; /* Why? */
2006#endif 2006#endif
2007
2008 x = w->phys_cursor.x;
2009 if (x < 0)
2010 {
2011 wd += x;
2012 x = 0;
2013 }
2014
2007 if (glyph->type == STRETCH_GLYPH 2015 if (glyph->type == STRETCH_GLYPH
2008 && !x_stretch_cursor_p) 2016 && !x_stretch_cursor_p)
2009 wd = min (FRAME_COLUMN_WIDTH (f), wd); 2017 wd = min (FRAME_COLUMN_WIDTH (f), wd);
@@ -2033,8 +2041,9 @@ get_phys_cursor_geometry (w, row, glyph, heightp)
2033 } 2041 }
2034 } 2042 }
2035 2043
2044 *xp = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, x);
2045 *yp = WINDOW_TO_FRAME_PIXEL_Y (w, y);
2036 *heightp = h; 2046 *heightp = h;
2037 return WINDOW_TO_FRAME_PIXEL_Y (w, y);
2038} 2047}
2039 2048
2040/* 2049/*
@@ -21319,7 +21328,7 @@ erase_phys_cursor (w)
21319 /* Maybe clear the display under the cursor. */ 21328 /* Maybe clear the display under the cursor. */
21320 if (w->phys_cursor_type == HOLLOW_BOX_CURSOR) 21329 if (w->phys_cursor_type == HOLLOW_BOX_CURSOR)
21321 { 21330 {
21322 int x, y; 21331 int x, y, left_x;
21323 int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); 21332 int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
21324 int width; 21333 int width;
21325 21334
@@ -21327,11 +21336,16 @@ erase_phys_cursor (w)
21327 if (cursor_glyph == NULL) 21336 if (cursor_glyph == NULL)
21328 goto mark_cursor_off; 21337 goto mark_cursor_off;
21329 21338
21330 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 21339 width = cursor_glyph->pixel_width;
21340 left_x = window_box_left_offset (w, TEXT_AREA);
21341 x = w->phys_cursor.x;
21342 if (x < left_x)
21343 width -= left_x - x;
21344 width = min (width, window_box_width (w, TEXT_AREA) - x);
21331 y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y)); 21345 y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y));
21332 width = min (cursor_glyph->pixel_width, 21346 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x));
21333 window_box_width (w, TEXT_AREA) - w->phys_cursor.x);
21334 21347
21348 if (width > 0)
21335 rif->clear_frame_area (f, x, y, width, cursor_row->visible_height); 21349 rif->clear_frame_area (f, x, y, width, cursor_row->visible_height);
21336 } 21350 }
21337 21351