GNU bug report logs - #65042
30.0.50; alpha-background doesn't effect background of stipple in emacs 30.0.50 pgtk

Previous Next

Package: emacs;

Reported by: Felix <felix.dick <at> web.de>

Date: Thu, 3 Aug 2023 16:08:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 65042 <at> debbugs.gnu.org (full text, mbox):

From: Felix <felix.dick <at> web.de>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 65042 <at> debbugs.gnu.org
Subject: Re: bug#65042: 30.0.50; alpha-background doesn't effect background
 of stipple in emacs 30.0.50 pgtk
Date: Fri, 04 Aug 2023 14:43:40 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Felix <felix.dick <at> web.de> writes:
>
>> Po Lu <luangruo <at> yahoo.com> writes:
>>
>>> Felix <felix.dick <at> web.de> writes:
>>>
>>>> The background of stipple stays opaque with alpha-background parameter
>>>> set for transparency.
>>>> This came up in the use of the new package 'indent-bars'.
>>>> The github issue: https://github.com/jdtsmith/indent-bars/issues/8
>>>> I tested this with 'emacs -Q' only enabling the needed packages (compat
>>>> and indent-bars).
>>>
>>> Thanks.  Do stipples start displaying adequately with this change?
>>>
>> No it doesn't.
>> But it gives weird artifacts (doubling the character one
>> line above or something like that)
>
> How about this?
>
> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
> index 9c1fc7bef4e..a7c687d811d 100644
> --- a/src/pgtkterm.c
> +++ b/src/pgtkterm.c
> @@ -1328,14 +1328,17 @@ fill_background_by_face (struct frame *f, struct face *face, int x, int y,
>  			 int width, int height)
>  {
>    cairo_t *cr = pgtk_begin_cr_clip (f);
> +  double r, g, b, a;
>
> +  cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
>    cairo_rectangle (cr, x, y, width, height);
>    cairo_clip (cr);
>
> -  double r = ((face->background >> 16) & 0xff) / 255.0;
> -  double g = ((face->background >> 8) & 0xff) / 255.0;
> -  double b = ((face->background >> 0) & 0xff) / 255.0;
> -  cairo_set_source_rgb (cr, r, g, b);
> +  r = ((face->background >> 16) & 0xff) / 255.0;
> +  g = ((face->background >> 8) & 0xff) / 255.0;
> +  b = ((face->background >> 0) & 0xff) / 255.0;
> +  a = f->alpha_background;
> +  cairo_set_source_rgba (cr, r, g, b, a);
>    cairo_paint (cr);
>
>    if (face->stipple != 0)
> @@ -1343,10 +1346,10 @@ fill_background_by_face (struct frame *f, struct face *face, int x, int y,
>        cairo_pattern_t *mask
>  	= FRAME_DISPLAY_INFO (f)->bitmaps[face->stipple - 1].pattern;
>
> -      double r = ((face->foreground >> 16) & 0xff) / 255.0;
> -      double g = ((face->foreground >> 8) & 0xff) / 255.0;
> -      double b = ((face->foreground >> 0) & 0xff) / 255.0;
> -      cairo_set_source_rgb (cr, r, g, b);
> +      r = ((face->foreground >> 16) & 0xff) / 255.0;
> +      g = ((face->foreground >> 8) & 0xff) / 255.0;
> +      b = ((face->foreground >> 0) & 0xff) / 255.0;
> +      cairo_set_source_rgba (cr, r, g, b, a);
>        cairo_mask (cr, mask);
>      }
>

This time it works,
Thanks for this, and thanks your work on Emacs in general!




This bug report was last modified 1 year and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.