aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2010-10-02 13:48:56 +0200
committerEli Zaretskii2010-10-02 13:48:56 +0200
commit12d54c2e095dee28d8829c93d14ae18f92f474fb (patch)
tree75005a58457b7c13762ab5db66f99ebba7838243
parent1b5a721bd5135792fface8df3849c3c42d4ca2c5 (diff)
downloademacs-12d54c2e095dee28d8829c93d14ae18f92f474fb.tar.gz
emacs-12d54c2e095dee28d8829c93d14ae18f92f474fb.zip
Fix minor bugs in mouse highlight.
xdisp.c (coords_in_mouse_face_p): Fix the conditions for when mouse_face_beg_row and mouse_face_end_row are equal. (note_mouse_highlight): Clear mouse highlight when mouse pointer is in a R2L row on the stretch glyph that stands for no text beyond the line end.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xdisp.c38
2 files changed, 36 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b846070b922..2b77f081f52 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12010-10-02 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (coords_in_mouse_face_p): Fix the conditions for when
4 mouse_face_beg_row and mouse_face_end_row are equal.
5 (note_mouse_highlight): Clear mouse highlight when mouse pointer
6 is in a R2L row on the stretch glyph that stands for no text
7 beyond the line end.
8
12010-08-28 Eli Zaretskii <eliz@gnu.org> 92010-08-28 Eli Zaretskii <eliz@gnu.org>
2 10
3 * xdisp.c (mouse_face_from_buffer_pos): Fix code using bug#1220 as 11 * xdisp.c (mouse_face_from_buffer_pos): Fix code using bug#1220 as
diff --git a/src/xdisp.c b/src/xdisp.c
index 40ba72a18bc..e19c26cbc19 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23832,20 +23832,30 @@ coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
23832 && vpos < dpyinfo->mouse_face_end_row) 23832 && vpos < dpyinfo->mouse_face_end_row)
23833 return 1; 23833 return 1;
23834 23834
23835 if (MATRIX_ROW (w->current_matrix, vpos)->reversed_p) 23835 if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p)
23836 { 23836 {
23837 if ((vpos == dpyinfo->mouse_face_beg_row 23837 if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row)
23838 && hpos <= dpyinfo->mouse_face_beg_col) 23838 {
23839 || (vpos == dpyinfo->mouse_face_end_row 23839 if (dpyinfo->mouse_face_beg_col <= hpos && hpos < dpyinfo->mouse_face_end_col)
23840 && hpos > dpyinfo->mouse_face_end_col)) 23840 return 1;
23841 }
23842 else if ((vpos == dpyinfo->mouse_face_beg_row
23843 && hpos >= dpyinfo->mouse_face_beg_col)
23844 || (vpos == dpyinfo->mouse_face_end_row
23845 && hpos < dpyinfo->mouse_face_end_col))
23841 return 1; 23846 return 1;
23842 } 23847 }
23843 else 23848 else
23844 { 23849 {
23845 if ((vpos == dpyinfo->mouse_face_beg_row 23850 if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row)
23846 && hpos >= dpyinfo->mouse_face_beg_col) 23851 {
23847 || (vpos == dpyinfo->mouse_face_end_row 23852 if (dpyinfo->mouse_face_end_col < hpos && hpos <= dpyinfo->mouse_face_beg_col)
23848 && hpos < dpyinfo->mouse_face_end_col)) 23853 return 1;
23854 }
23855 else if ((vpos == dpyinfo->mouse_face_beg_row
23856 && hpos <= dpyinfo->mouse_face_beg_col)
23857 || (vpos == dpyinfo->mouse_face_end_row
23858 && hpos > dpyinfo->mouse_face_end_col))
23849 return 1; 23859 return 1;
23850 } 23860 }
23851 return 0; 23861 return 0;
@@ -24846,7 +24856,15 @@ note_mouse_highlight (struct frame *f, int x, int y)
24846 /* Clear mouse face if X/Y not over text. */ 24856 /* Clear mouse face if X/Y not over text. */
24847 if (glyph == NULL 24857 if (glyph == NULL
24848 || area != TEXT_AREA 24858 || area != TEXT_AREA
24849 || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p) 24859 || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p
24860 /* R2L rows have a stretch glyph at their front, which
24861 stands for no text, whereas L2R rows have no glyphs at
24862 all beyond the end of text. Treat such stretch glyphs as
24863 NULL glyphs in L2R rows. */
24864 || (MATRIX_ROW (w->current_matrix, vpos)->reversed_p
24865 && glyph == MATRIX_ROW (w->current_matrix, vpos)->glyphs[TEXT_AREA]
24866 && glyph->type == STRETCH_GLYPH
24867 && glyph->avoid_cursor_p))
24850 { 24868 {
24851 if (clear_mouse_face (dpyinfo)) 24869 if (clear_mouse_face (dpyinfo))
24852 cursor = No_Cursor; 24870 cursor = No_Cursor;