emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115535: Fix bug #16151 with background of display m


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r115535: Fix bug #16151 with background of display margins.
Date: Sun, 15 Dec 2013 16:52:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115535
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16151
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sun 2013-12-15 18:51:59 +0200
message:
  Fix bug #16151 with background of display margins.
  
   src/xdisp.c (extend_face_to_end_of_line): Extend background of
   non-default face in margin areas as well.  (Bug#16151)
   (display_line): Call extend_face_to_end_of_line for continued
   lines as well, if the display margins have non-zero width.
   (set_glyph_string_background_width): When needed, set the
   extends_to_end_of_line_p flag on glyph strings to be drawn in
   margin areas, not only in the text area.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-12-15 16:27:25 +0000
+++ b/src/ChangeLog     2013-12-15 16:51:59 +0000
@@ -1,5 +1,13 @@
 2013-12-15  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (extend_face_to_end_of_line): Extend background of
+       non-default face in margin areas as well.  (Bug#16151)
+       (display_line): Call extend_face_to_end_of_line for continued
+       lines as well, if the display margins have non-zero width.
+       (set_glyph_string_background_width): When needed, set the
+       extends_to_end_of_line_p flag on glyph strings to be drawn in
+       margin areas, not only in the text area.
+
        * frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at
        startup.
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-12-15 04:20:53 +0000
+++ b/src/xdisp.c       2013-12-15 16:51:59 +0000
@@ -18808,10 +18808,14 @@
      1-``pixel'' wide, so they hit the equality too early.  This grace
      is needed only for R2L rows that are not continued, to produce
      one extra blank where we could display the cursor.  */
-  if (it->current_x >= it->last_visible_x
-      + (!FRAME_WINDOW_P (f)
-        && it->glyph_row->reversed_p
-        && !it->glyph_row->continued_p))
+  if ((it->current_x >= it->last_visible_x
+       + (!FRAME_WINDOW_P (f)
+         && it->glyph_row->reversed_p
+         && !it->glyph_row->continued_p))
+      /* If the window has display margins, we will need to extend
+        their face even if the text area is filled.  */
+      && !(WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+          || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0))
     return;
 
   /* The default face, possibly remapped. */
@@ -18859,6 +18863,20 @@
          it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id;
          it->glyph_row->used[TEXT_AREA] = 1;
        }
+      if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+         && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
+       {
+         it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
+         it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
+         it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
+       }
+      if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
+         && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
+       {
+         it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
+         it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
+         it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
+       }
 #ifdef HAVE_WINDOW_SYSTEM
       if (it->glyph_row->reversed_p)
        {
@@ -18932,11 +18950,61 @@
       else
        it->face_id = face->id;
 
+      face = FACE_FROM_ID (f, it->face_id);
+      if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+         && (it->glyph_row->used[LEFT_MARGIN_AREA]
+             < WINDOW_LEFT_MARGIN_WIDTH (it->w))
+         && !it->glyph_row->mode_line_p
+         && face && face->background != FRAME_BACKGROUND_PIXEL (f))
+       {
+         struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA];
+         struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA];
+
+         for (it->current_x = 0; g < e; g++)
+           it->current_x += g->pixel_width;
+
+         it->area = LEFT_MARGIN_AREA;
+         while (it->glyph_row->used[LEFT_MARGIN_AREA]
+                < WINDOW_LEFT_MARGIN_WIDTH (it->w))
+           {
+             PRODUCE_GLYPHS (it);
+             /* term.c:produce_glyphs advances it->current_x only for
+                TEXT_AREA.  */
+             it->current_x += it->pixel_width;
+           }
+
+         it->current_x = saved_x;
+         it->area = TEXT_AREA;
+       }
+
       PRODUCE_GLYPHS (it);
 
       while (it->current_x <= it->last_visible_x)
        PRODUCE_GLYPHS (it);
 
+      if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
+         && (it->glyph_row->used[RIGHT_MARGIN_AREA]
+             < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
+         && !it->glyph_row->mode_line_p
+         && face && face->background != FRAME_BACKGROUND_PIXEL (f))
+       {
+         struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA];
+         struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA];
+
+         for ( ; g < e; g++)
+           it->current_x += g->pixel_width;
+
+         it->area = RIGHT_MARGIN_AREA;
+         while (it->glyph_row->used[RIGHT_MARGIN_AREA]
+                < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
+           {
+             PRODUCE_GLYPHS (it);
+             it->current_x += it->pixel_width;
+           }
+
+         it->area = TEXT_AREA;
+       }
+
       /* Don't count these blanks really.  It would let us insert a left
         truncation glyph below and make us set the cursor on them, maybe.  */
       it->current_x = saved_x;
@@ -19789,6 +19857,9 @@
                        }
                      else if (it->bidi_p)
                        RECORD_MAX_MIN_POS (it);
+                     if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+                         || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
+                       extend_face_to_end_of_line (it);
                    }
                  else if (CHAR_GLYPH_PADDING_P (*glyph)
                           && !FRAME_WINDOW_P (it->f))
@@ -19817,6 +19888,9 @@
                      it->max_descent = descent;
                      it->max_phys_ascent = phys_ascent;
                      it->max_phys_descent = phys_descent;
+                     if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+                         || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
+                       extend_face_to_end_of_line (it);
                    }
                  else if (wrap_row_used > 0)
                    {
@@ -19861,6 +19935,9 @@
                      row->continued_p = 1;
                      glyph->pixel_width = it->last_visible_x - x;
                      it->starts_in_middle_of_char_p = 1;
+                     if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
+                         || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
+                       extend_face_to_end_of_line (it);
                    }
                  else
                    {
@@ -23796,7 +23873,6 @@
      the drawing area, set S->extends_to_end_of_line_p.  */
 
   if (start == s->row->used[s->area]
-      && s->area == TEXT_AREA
       && ((s->row->fill_line_p
           && (s->hl == DRAW_NORMAL_TEXT
               || s->hl == DRAW_IMAGE_RAISED


reply via email to

[Prev in Thread] Current Thread [Next in Thread]