From f0ad2f4c896ffd59f3f0e7fc3c717b52e8205c1a Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 10 Oct 2005 22:54:19 +0000 Subject: [PATCH] (glyph_rect): Return 0 if position is outside text area. --- src/xterm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) Lisp_Object window; struct window *w; struct glyph_row *r, *end_row; + enum window_part part; - window = window_from_coordinates (f, x, y, 0, &x, &y, 0); + window = window_from_coordinates (f, x, y, &part, &x, &y, 0); if (NILP (window)) return 0; @@ -3656,6 +3657,9 @@ glyph_rect (f, x, y, rect) r = MATRIX_FIRST_TEXT_ROW (w->current_matrix); end_row = r + w->current_matrix->nrows - 1; + if (part != ON_TEXT) + return 0; + for (; r < end_row && r->enabled_p; ++r) { if (r->y >= y) -- 2.39.5