From: YAMAMOTO Mitsuharu Date: Wed, 12 Oct 2005 09:50:50 +0000 (+0000) Subject: (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to X-Git-Tag: emacs-pretest-22.0.90~6648 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=76d8f04c6d9974b985be86694026feaa7f29e965;p=emacs.git (remember_mouse_glyph): Use MATRIX_BOTTOM_TEXT_ROW to get end of text rows. Obtain header-line/mode-line rows directly. --- diff --git a/src/ChangeLog b/src/ChangeLog index d8c93e96754..fef8efe2c12 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-10-12 YAMAMOTO Mitsuharu + + * 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 * xdisp.c (remember_mouse_glyph): New generic version based on diff --git a/src/xdisp.c b/src/xdisp.c index 14757b92c59..de24049d830 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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;