]> git.eshelyaron.com Git - emacs.git/commitdiff
* xdisp.c (note_mode_line_or_margin_highlight): Check
authorMasatake YAMATO <jet@gyve.org>
Tue, 7 Jun 2005 14:32:23 +0000 (14:32 +0000)
committerMasatake YAMATO <jet@gyve.org>
Tue, 7 Jun 2005 14:32:23 +0000 (14:32 +0000)
the overlapping of re-rendering area to avoid flickering.
(note_mouse_highlight): Call clear_mouse_face if PART
is not ON_MODE_LINE nor ON_HEADER_LINE.

src/ChangeLog
src/xdisp.c

index 0651dc206a06036f59d51ba03ad51d34e0c761f8..003668db5600cf037205219e30e03752c56c1f94 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-07  Masatake YAMATO  <jet@gyve.org>
+
+       * xdisp.c (note_mode_line_or_margin_highlight): Check
+       the overlapping of re-rendering area to avoid flickering.
+       (note_mouse_highlight): Call clear_mouse_face if PART 
+       is not ON_MODE_LINE nor ON_HEADER_LINE.
+
 2005-06-07  Kim F. Storm  <storm@cua.dk>
 
        * process.c: Improve commentary for adaptive read buffering.
index c1ea2a9389a9e23855bbfc7f8f5047f06aab1ff8..47421d13115f7f646182ce699702f9f04e621f5d 100644 (file)
@@ -21491,10 +21491,8 @@ note_mode_line_or_margin_highlight (window, x, y, area)
          int total_pixel_width;
          int ignore;
 
-
-         if (clear_mouse_face (dpyinfo))
-           cursor = No_Cursor;
-
+         int vpos, hpos;
+         
          b = Fprevious_single_property_change (make_number (charpos + 1),
                                                Qmouse_face, string, Qnil);
          if (NILP (b))
@@ -21537,15 +21535,30 @@ note_mode_line_or_margin_highlight (window, x, y, area)
          for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++)
            total_pixel_width += tmp_glyph->pixel_width;
 
-         dpyinfo->mouse_face_beg_col = (x - gpos);
-         dpyinfo->mouse_face_beg_row = (area == ON_MODE_LINE
-                                        ? (w->current_matrix)->nrows - 1
-                                        : 0);
+         /* Pre calculation of re-rendering position */
+         vpos = (x - gpos);
+         hpos = (area == ON_MODE_LINE
+                 ? (w->current_matrix)->nrows - 1
+                 : 0);
+         
+         /* If the re-rendering position is included in the last
+            re-rendering area, we should do nothing. */
+         if ( window == dpyinfo->mouse_face_window
+              && dpyinfo->mouse_face_beg_col <= vpos
+              && vpos < dpyinfo->mouse_face_end_col
+              && dpyinfo->mouse_face_beg_row == hpos )
+           return;
+         
+         if (clear_mouse_face (dpyinfo))
+           cursor = No_Cursor;
+         
+         dpyinfo->mouse_face_beg_col = vpos;
+         dpyinfo->mouse_face_beg_row = hpos;
 
          dpyinfo->mouse_face_beg_x   = original_x_pixel - (total_pixel_width + dx);
          dpyinfo->mouse_face_beg_y   = 0;
 
-         dpyinfo->mouse_face_end_col = (x - gpos) + gseq_length;
+         dpyinfo->mouse_face_end_col = vpos + gseq_length;
          dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row;
 
          dpyinfo->mouse_face_end_x   = 0;
@@ -21617,7 +21630,8 @@ note_mouse_highlight (f, x, y)
   /* If we were displaying active text in another window, clear that.
      Also clear if we move out of text area in same window.  */
   if (! EQ (window, dpyinfo->mouse_face_window)
-      || (part != ON_TEXT && !NILP (dpyinfo->mouse_face_window)))
+      || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE 
+         && !NILP (dpyinfo->mouse_face_window)))
     clear_mouse_face (dpyinfo);
 
   /* Not on a window -> return.  */