aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2005-10-10 22:54:19 +0000
committerKim F. Storm2005-10-10 22:54:19 +0000
commitf0ad2f4c896ffd59f3f0e7fc3c717b52e8205c1a (patch)
tree8353511e9eb5fa0358886e8f008777230cd4f67c
parent31ab1f0585b47a6dbe54b5451e94c1ed64bf1347 (diff)
downloademacs-f0ad2f4c896ffd59f3f0e7fc3c717b52e8205c1a.tar.gz
emacs-f0ad2f4c896ffd59f3f0e7fc3c717b52e8205c1a.zip
(glyph_rect): Return 0 if position is outside text area.
-rw-r--r--src/xterm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index c2fb207bcb1..a4ad061e8db 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3647,8 +3647,9 @@ glyph_rect (f, x, y, rect)
3647 Lisp_Object window; 3647 Lisp_Object window;
3648 struct window *w; 3648 struct window *w;
3649 struct glyph_row *r, *end_row; 3649 struct glyph_row *r, *end_row;
3650 enum window_part part;
3650 3651
3651 window = window_from_coordinates (f, x, y, 0, &x, &y, 0); 3652 window = window_from_coordinates (f, x, y, &part, &x, &y, 0);
3652 if (NILP (window)) 3653 if (NILP (window))
3653 return 0; 3654 return 0;
3654 3655
@@ -3656,6 +3657,9 @@ glyph_rect (f, x, y, rect)
3656 r = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 3657 r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
3657 end_row = r + w->current_matrix->nrows - 1; 3658 end_row = r + w->current_matrix->nrows - 1;
3658 3659
3660 if (part != ON_TEXT)
3661 return 0;
3662
3659 for (; r < end_row && r->enabled_p; ++r) 3663 for (; r < end_row && r->enabled_p; ++r)
3660 { 3664 {
3661 if (r->y >= y) 3665 if (r->y >= y)