aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2024-04-15 09:21:17 +0800
committerPo Lu2024-04-15 09:30:30 +0800
commite8c6e3fa477e69b4cecfee354af313ccb60e8c97 (patch)
tree000ee7ad69eaa8050df924a444f608807d5d1d6d
parent3d3602055264ca3095b7f28ca7e27a6f2782649a (diff)
downloademacs-e8c6e3fa477e69b4cecfee354af313ccb60e8c97.tar.gz
emacs-e8c6e3fa477e69b4cecfee354af313ccb60e8c97.zip
Fix bug#70385
* src/xdisp.c (note_fringe_highlight): Don't proceed if popup_activated, window is outdated, or when row beneath pointer does not display text. (bug#70385)
-rw-r--r--src/xdisp.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 452adee1d31..d984c12d1aa 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -35731,16 +35731,28 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
35731 35731
35732 35732
35733/* Take proper action when mouse has moved to the window WINDOW, with 35733/* Take proper action when mouse has moved to the window WINDOW, with
35734 window-local x-position X and y-position Y. This is only used for 35734 window-local x-position X and y-position Y. This is only used for
35735 displaying user-defined fringe indicator help-echo messages. */ 35735 displaying user-defined fringe indicator help-echo messages. */
35736 35736
35737static void 35737static void
35738note_fringe_highlight (Lisp_Object window, int x, int y, 35738note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y,
35739 enum window_part part) 35739 enum window_part part)
35740{ 35740{
35741 if (!NILP (help_echo_string)) 35741 if (!NILP (help_echo_string) || !f->glyphs_initialized_p)
35742 return; 35742 return;
35743 35743
35744 /* When a menu is active, don't highlight because this looks odd. */
35745#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) || defined (MSDOS) \
35746 || defined (HAVE_ANDROID)
35747 if (popup_activated ())
35748 return;
35749#endif /* HAVE_X_WINDOWS || HAVE_NS || MSDOS || HAVE_ANDROID */
35750
35751#if defined HAVE_HAIKU
35752 if (popup_activated_p)
35753 return;
35754#endif /* HAVE_HAIKU */
35755
35744 /* Find a message to display through the help-echo mechanism whenever 35756 /* Find a message to display through the help-echo mechanism whenever
35745 the mouse hovers over a fringe indicator. Both text properties and 35757 the mouse hovers over a fringe indicator. Both text properties and
35746 overlays have to be checked. */ 35758 overlays have to be checked. */
@@ -35757,6 +35769,13 @@ note_fringe_highlight (Lisp_Object window, int x, int y,
35757 struct window *w = XWINDOW (window); 35769 struct window *w = XWINDOW (window);
35758 x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, 0, 0, &area); 35770 x_y_to_hpos_vpos (w, x, y, &hpos, &vpos, 0, 0, &area);
35759 35771
35772 /* Don't access the TEXT_AREA of a row that does not display text, or
35773 when the window is outdated. (bug#70385) */
35774 if (window_outdated (w)
35775 || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix,
35776 vpos)))
35777 return;
35778
35760 /* Get to the first glyph of a text row based on the vertical position 35779 /* Get to the first glyph of a text row based on the vertical position
35761 of the fringe. */ 35780 of the fringe. */
35762 struct glyph *glyph = MATRIX_ROW_GLYPH_START (w->current_matrix, vpos); 35781 struct glyph *glyph = MATRIX_ROW_GLYPH_START (w->current_matrix, vpos);
@@ -36014,7 +36033,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
36014 else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE) 36033 else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE)
36015 { 36034 {
36016 cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor; 36035 cursor = FRAME_OUTPUT_DATA (f)->nontext_cursor;
36017 note_fringe_highlight (window, x, y, part); 36036 note_fringe_highlight (f, window, x, y, part);
36018 } 36037 }
36019 else if (part == ON_VERTICAL_SCROLL_BAR 36038 else if (part == ON_VERTICAL_SCROLL_BAR
36020 || part == ON_HORIZONTAL_SCROLL_BAR) 36039 || part == ON_HORIZONTAL_SCROLL_BAR)