]> git.eshelyaron.com Git - emacs.git/commitdiff
Make cursor alpha consistent with a transparent background
authorPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 05:06:14 +0000 (13:06 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 31 Jan 2022 05:06:14 +0000 (13:06 +0800)
* src/xfont.c (xfont_draw):
* src/xftfont.c (xftfont_shape):
* src/xterm.c (x_clear_glyph_string_rect): Don't respect
background alpha when drawing the cursor.

src/xfont.c
src/xftfont.c
src/xterm.c

index 7a50378a006acd91330e2467e2d22f43a96b87a0..78f5f19bc8427cc4e4589c7dfd38dba6f564597e 100644 (file)
@@ -1016,7 +1016,8 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y,
          int height = FONT_HEIGHT (s->font), ascent = FONT_BASE (s->font);
 
          x_xr_apply_ext_clip (s->f, gc);
-         x_xrender_color_from_gc_background (s->f, gc, &xc, true);
+         x_xrender_color_from_gc_background (s->f, gc, &xc,
+                                             s->hl != DRAW_CURSOR);
          XRenderFillRectangle (FRAME_X_DISPLAY (s->f),
                                PictOpSrc, FRAME_X_PICTURE (s->f),
                                &xc, x, y - ascent, s->width, height);
index 1fcc0f452844eda7d0297e2bde09fc7564ba5021..cfbf7cdc7acc2ce101c0ad1befc33049b2f77e2d 100644 (file)
@@ -519,7 +519,7 @@ xftfont_draw (struct glyph_string *s, int from, int to, int x, int y,
                                                 0, 0, s->clip, s->num_clips);
              else
                x_xr_reset_ext_clip (f);
-             x_xrender_color_from_gc_background (s->f, s->gc, &xc, true);
+             x_xrender_color_from_gc_background (s->f, s->gc, &xc, s->hl != DRAW_CURSOR);
              XRenderFillRectangle (FRAME_X_DISPLAY (s->f),
                                    PictOpSrc, FRAME_X_PICTURE (s->f),
                                    &xc, x, y - ascent, s->width, height);
index e7019a3a7477f4bf9455ff3e582e6c38224c8978..edafd882119b85c2239fc10e1eae4781c8d59652 100644 (file)
@@ -2357,7 +2357,9 @@ x_compute_glyph_string_overhangs (struct glyph_string *s)
 static void
 x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h)
 {
-  x_clear_rectangle (s->f, s->gc, x, y, w, h, true);
+  x_clear_rectangle (s->f, s->gc, x, y, w, h,
+                    (s->first_glyph->type != STRETCH_GLYPH
+                     || s->hl != DRAW_CURSOR));
 }