changeset 66039:d95deb0b55d2

(remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to get end of text rows. Obtain header-line/mode-line rows directly.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 12 Oct 2005 09:50:06 +0000
parents 82f31f593478
children 116ad52c3aa9
files src/xdisp.c
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Wed Oct 12 09:16:55 2005 +0000
+++ b/src/xdisp.c	Wed Oct 12 09:50:06 2005 +0000
@@ -2060,7 +2060,7 @@
   height = WINDOW_FRAME_LINE_HEIGHT (w);
 
   r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
-  end_row = r + w->current_matrix->nrows - 1;
+  end_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
 
   if (w->pseudo_window_p)
     {
@@ -2079,20 +2079,28 @@
       area = RIGHT_MARGIN_AREA;
       goto text_glyph;
 
-    case ON_TEXT:
+    case ON_HEADER_LINE:
     case ON_MODE_LINE:
-    case ON_HEADER_LINE:
+      gr = (part == ON_HEADER_LINE
+	    ? MATRIX_HEADER_LINE_ROW (w->current_matrix)
+	    : MATRIX_MODE_LINE_ROW (w->current_matrix));
+      gy = gr->y;
+      area = TEXT_AREA;
+      goto text_glyph_row_found;
+
+    case ON_TEXT:
       area = TEXT_AREA;
 
     text_glyph:
       gr = 0; gy = 0;
-      for (; r < end_row && r->enabled_p; ++r)
+      for (; r <= end_row && r->enabled_p; ++r)
 	if (r->y + r->height > y)
 	  {
 	    gr = r; gy = r->y;
 	    break;
 	  }
 
+    text_glyph_row_found:
       if (gr && gy <= y)
 	{
 	  struct glyph *g = gr->glyphs[area];
@@ -2149,7 +2157,7 @@
 
     row_glyph:
       gr = 0, gy = 0;
-      for (; r < end_row && r->enabled_p; ++r)
+      for (; r <= end_row && r->enabled_p; ++r)
 	if (r->y + r->height > y)
 	  {
 	    gr = r; gy = r->y;