]> git.eshelyaron.com Git - emacs.git/commitdiff
(remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Oct 2005 09:50:50 +0000 (09:50 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Oct 2005 09:50:50 +0000 (09:50 +0000)
get end of text rows.  Obtain header-line/mode-line rows directly.

src/ChangeLog
src/xdisp.c

index d8c93e96754172d724bca2349444dc5ebe4e7fa7..fef8efe2c12ea65ac79116e4691c2c302e3b5f07 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * xdisp.c (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to
+       get end of text rows.  Obtain header-line/mode-line rows directly.
+
 2005-10-12  Kim F. Storm  <storm@cua.dk>
 
        * xdisp.c (remember_mouse_glyph): New generic version based on
index 14757b92c59ad1a8d13fb6ccd3b94fc58512d616..de24049d8308a45cf8eece5bc479afac66cf6aca 100644 (file)
@@ -2060,7 +2060,7 @@ remember_mouse_glyph (f, gx, gy, rect)
   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 @@ remember_mouse_glyph (f, gx, gy, rect)
       area = RIGHT_MARGIN_AREA;
       goto text_glyph;
 
-    case ON_TEXT:
-    case ON_MODE_LINE:
     case ON_HEADER_LINE:
+    case ON_MODE_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 @@ remember_mouse_glyph (f, gx, gy, rect)
 
     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;