changeset 66003:eefcdbee90bc

(glyph_rect): Return 0 if position is outside text area.
author Kim F. Storm <storm@cua.dk>
date Mon, 10 Oct 2005 22:54:19 +0000
parents f9d092cc84bb
children 12bd2d0d9bb2
files src/xterm.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Oct 10 22:54:03 2005 +0000
+++ b/src/xterm.c	Mon Oct 10 22:54:19 2005 +0000
@@ -3647,8 +3647,9 @@
   Lisp_Object window;
   struct window *w;
   struct glyph_row *r, *end_row;
-
-  window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
+  enum window_part part;
+
+  window = window_from_coordinates (f, x, y, &part, &x, &y, 0);
   if (NILP (window))
     return 0;
 
@@ -3656,6 +3657,9 @@
   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)