aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-12-15 18:51:59 +0200
committerEli Zaretskii2013-12-15 18:51:59 +0200
commitcdeb10ce512b9b579add9dc358d90e1ab6475f6e (patch)
tree68a61b7d60d266b3d96eaab8b2446e10231c1141
parentdd1fb8cb77da751a2c397f7492750b9ba79214b3 (diff)
downloademacs-cdeb10ce512b9b579add9dc358d90e1ab6475f6e.tar.gz
emacs-cdeb10ce512b9b579add9dc358d90e1ab6475f6e.zip
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.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/xdisp.c86
2 files changed, 89 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ccf107e307b..90b6525a55d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12013-12-15 Eli Zaretskii <eliz@gnu.org> 12013-12-15 Eli Zaretskii <eliz@gnu.org>
2 2
3 * xdisp.c (extend_face_to_end_of_line): Extend background of
4 non-default face in margin areas as well. (Bug#16151)
5 (display_line): Call extend_face_to_end_of_line for continued
6 lines as well, if the display margins have non-zero width.
7 (set_glyph_string_background_width): When needed, set the
8 extends_to_end_of_line_p flag on glyph strings to be drawn in
9 margin areas, not only in the text area.
10
3 * frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at 11 * frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at
4 startup. 12 startup.
5 13
diff --git a/src/xdisp.c b/src/xdisp.c
index b5274b53229..bd57dc9e278 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18808,10 +18808,14 @@ extend_face_to_end_of_line (struct it *it)
18808 1-``pixel'' wide, so they hit the equality too early. This grace 18808 1-``pixel'' wide, so they hit the equality too early. This grace
18809 is needed only for R2L rows that are not continued, to produce 18809 is needed only for R2L rows that are not continued, to produce
18810 one extra blank where we could display the cursor. */ 18810 one extra blank where we could display the cursor. */
18811 if (it->current_x >= it->last_visible_x 18811 if ((it->current_x >= it->last_visible_x
18812 + (!FRAME_WINDOW_P (f) 18812 + (!FRAME_WINDOW_P (f)
18813 && it->glyph_row->reversed_p 18813 && it->glyph_row->reversed_p
18814 && !it->glyph_row->continued_p)) 18814 && !it->glyph_row->continued_p))
18815 /* If the window has display margins, we will need to extend
18816 their face even if the text area is filled. */
18817 && !(WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
18818 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0))
18815 return; 18819 return;
18816 18820
18817 /* The default face, possibly remapped. */ 18821 /* The default face, possibly remapped. */
@@ -18859,6 +18863,20 @@ extend_face_to_end_of_line (struct it *it)
18859 it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id; 18863 it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id;
18860 it->glyph_row->used[TEXT_AREA] = 1; 18864 it->glyph_row->used[TEXT_AREA] = 1;
18861 } 18865 }
18866 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
18867 && it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
18868 {
18869 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
18870 it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
18871 it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
18872 }
18873 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
18874 && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
18875 {
18876 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
18877 it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
18878 it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
18879 }
18862#ifdef HAVE_WINDOW_SYSTEM 18880#ifdef HAVE_WINDOW_SYSTEM
18863 if (it->glyph_row->reversed_p) 18881 if (it->glyph_row->reversed_p)
18864 { 18882 {
@@ -18932,11 +18950,61 @@ extend_face_to_end_of_line (struct it *it)
18932 else 18950 else
18933 it->face_id = face->id; 18951 it->face_id = face->id;
18934 18952
18953 face = FACE_FROM_ID (f, it->face_id);
18954 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
18955 && (it->glyph_row->used[LEFT_MARGIN_AREA]
18956 < WINDOW_LEFT_MARGIN_WIDTH (it->w))
18957 && !it->glyph_row->mode_line_p
18958 && face && face->background != FRAME_BACKGROUND_PIXEL (f))
18959 {
18960 struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA];
18961 struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA];
18962
18963 for (it->current_x = 0; g < e; g++)
18964 it->current_x += g->pixel_width;
18965
18966 it->area = LEFT_MARGIN_AREA;
18967 while (it->glyph_row->used[LEFT_MARGIN_AREA]
18968 < WINDOW_LEFT_MARGIN_WIDTH (it->w))
18969 {
18970 PRODUCE_GLYPHS (it);
18971 /* term.c:produce_glyphs advances it->current_x only for
18972 TEXT_AREA. */
18973 it->current_x += it->pixel_width;
18974 }
18975
18976 it->current_x = saved_x;
18977 it->area = TEXT_AREA;
18978 }
18979
18935 PRODUCE_GLYPHS (it); 18980 PRODUCE_GLYPHS (it);
18936 18981
18937 while (it->current_x <= it->last_visible_x) 18982 while (it->current_x <= it->last_visible_x)
18938 PRODUCE_GLYPHS (it); 18983 PRODUCE_GLYPHS (it);
18939 18984
18985 if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
18986 && (it->glyph_row->used[RIGHT_MARGIN_AREA]
18987 < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
18988 && !it->glyph_row->mode_line_p
18989 && face && face->background != FRAME_BACKGROUND_PIXEL (f))
18990 {
18991 struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA];
18992 struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA];
18993
18994 for ( ; g < e; g++)
18995 it->current_x += g->pixel_width;
18996
18997 it->area = RIGHT_MARGIN_AREA;
18998 while (it->glyph_row->used[RIGHT_MARGIN_AREA]
18999 < WINDOW_RIGHT_MARGIN_WIDTH (it->w))
19000 {
19001 PRODUCE_GLYPHS (it);
19002 it->current_x += it->pixel_width;
19003 }
19004
19005 it->area = TEXT_AREA;
19006 }
19007
18940 /* Don't count these blanks really. It would let us insert a left 19008 /* Don't count these blanks really. It would let us insert a left
18941 truncation glyph below and make us set the cursor on them, maybe. */ 19009 truncation glyph below and make us set the cursor on them, maybe. */
18942 it->current_x = saved_x; 19010 it->current_x = saved_x;
@@ -19789,6 +19857,9 @@ display_line (struct it *it)
19789 } 19857 }
19790 else if (it->bidi_p) 19858 else if (it->bidi_p)
19791 RECORD_MAX_MIN_POS (it); 19859 RECORD_MAX_MIN_POS (it);
19860 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
19861 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
19862 extend_face_to_end_of_line (it);
19792 } 19863 }
19793 else if (CHAR_GLYPH_PADDING_P (*glyph) 19864 else if (CHAR_GLYPH_PADDING_P (*glyph)
19794 && !FRAME_WINDOW_P (it->f)) 19865 && !FRAME_WINDOW_P (it->f))
@@ -19817,6 +19888,9 @@ display_line (struct it *it)
19817 it->max_descent = descent; 19888 it->max_descent = descent;
19818 it->max_phys_ascent = phys_ascent; 19889 it->max_phys_ascent = phys_ascent;
19819 it->max_phys_descent = phys_descent; 19890 it->max_phys_descent = phys_descent;
19891 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
19892 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
19893 extend_face_to_end_of_line (it);
19820 } 19894 }
19821 else if (wrap_row_used > 0) 19895 else if (wrap_row_used > 0)
19822 { 19896 {
@@ -19861,6 +19935,9 @@ display_line (struct it *it)
19861 row->continued_p = 1; 19935 row->continued_p = 1;
19862 glyph->pixel_width = it->last_visible_x - x; 19936 glyph->pixel_width = it->last_visible_x - x;
19863 it->starts_in_middle_of_char_p = 1; 19937 it->starts_in_middle_of_char_p = 1;
19938 if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
19939 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)
19940 extend_face_to_end_of_line (it);
19864 } 19941 }
19865 else 19942 else
19866 { 19943 {
@@ -23796,7 +23873,6 @@ set_glyph_string_background_width (struct glyph_string *s, int start, int last_x
23796 the drawing area, set S->extends_to_end_of_line_p. */ 23873 the drawing area, set S->extends_to_end_of_line_p. */
23797 23874
23798 if (start == s->row->used[s->area] 23875 if (start == s->row->used[s->area]
23799 && s->area == TEXT_AREA
23800 && ((s->row->fill_line_p 23876 && ((s->row->fill_line_p
23801 && (s->hl == DRAW_NORMAL_TEXT 23877 && (s->hl == DRAW_NORMAL_TEXT
23802 || s->hl == DRAW_IMAGE_RAISED 23878 || s->hl == DRAW_IMAGE_RAISED