summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-01-31 13:06:14 +0800
committerPo Lu <luangruo@yahoo.com>2022-01-31 13:06:14 +0800
commiteb9dd321309d08708d65ad0c002238275c35c651 (patch)
tree7a449dcb8d695ae2f941c599e39f619d6c6b9fd2
parentae8332b83093d7a3f879d87599e207d3dc215f88 (diff)
downloademacs-eb9dd321309d08708d65ad0c002238275c35c651.tar.gz
emacs-eb9dd321309d08708d65ad0c002238275c35c651.tar.bz2
emacs-eb9dd321309d08708d65ad0c002238275c35c651.zip
Make cursor alpha consistent with a transparent background
* 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.
-rw-r--r--src/xfont.c3
-rw-r--r--src/xftfont.c2
-rw-r--r--src/xterm.c4
3 files changed, 6 insertions, 3 deletions
diff --git a/src/xfont.c b/src/xfont.c
index 7a50378a006..78f5f19bc84 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -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);
diff --git a/src/xftfont.c b/src/xftfont.c
index 1fcc0f45284..cfbf7cdc7ac 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -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);
diff --git a/src/xterm.c b/src/xterm.c
index e7019a3a747..edafd882119 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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));
}