all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nate Sandy <nsan@posteo.de>
To: 69782@debbugs.gnu.org
Subject: bug#69782: [PATCH] Fringe bitmaps should respect alpha-background
Date: Wed, 13 Mar 2024 19:13:34 +0000	[thread overview]
Message-ID: <87edcex7vl.fsf@posteo.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

Hi,

fringe bitmaps currently don't respect the frame parameter
'alpha-background', i.e., their background is opaque. But since the
fringe itself *does* respect 'alpha-background', fringe bitmaps should
do the same. This patch fixes that. See attached screenshots for the
effect.
The alpha-background used here was set with:
  (set-frame-parameter nil 'alpha-background 50)
  
I am not sure which other platforms support 'alpha-background', and
unfortunately I am not able to test with those. This patch applies to
the pgtk and X Linux builds.

The change is altering the parameter 'respect_alpha_background' in
{pgtk,x}_cr_draw_image - while this name sounds quite generic, I didn't
find any other usages of this function than drawing fringe bitmaps. I
hope I didn't miss any.

I hope that I'm following the conventions here correctly - please let me
know if I can improve anything!

Best
Nate


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fringe bitmaps respect alpha-background. --]
[-- Type: text/x-patch, Size: 1319 bytes --]

From 5f1e653dc53d2838660edc267e6cf4e599a351b7 Mon Sep 17 00:00:00 2001
From: Nate Sandy <nsan@posteo.de>
Date: Wed, 13 Mar 2024 19:58:04 +0100
Subject: [PATCH] Make fringe bitmaps respect alpha-background

---
 src/pgtkterm.c | 2 +-
 src/xterm.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 1ec6bfcda4..d891c6a23b 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -2193,7 +2193,7 @@ pgtk_cr_draw_image (struct frame *f, Emacs_GC *gc, cairo_pattern_t *image,
     cairo_rectangle (cr, dest_x, dest_y, width, height);
   else
     {
-      pgtk_set_cr_source_with_gc_background (f, gc, false);
+      pgtk_set_cr_source_with_gc_background (f, gc, true);
       cairo_rectangle (cr, dest_x, dest_y, width, height);
       cairo_fill_preserve (cr);
     }
diff --git a/src/xterm.c b/src/xterm.c
index c8a4378556..5e97489751 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6298,7 +6298,7 @@ x_cr_draw_image (struct frame *f, GC gc, cairo_pattern_t *image,
     cairo_rectangle (cr, dest_x, dest_y, width, height);
   else
     {
-      x_set_cr_source_with_gc_background (f, gc, false);
+      x_set_cr_source_with_gc_background (f, gc, true);
       cairo_rectangle (cr, dest_x, dest_y, width, height);
       cairo_fill_preserve (cr);
     }
-- 
2.43.1


[-- Attachment #3: Fringe bitmaps don't respect alpha-background. --]
[-- Type: image/png, Size: 35462 bytes --]

[-- Attachment #4: Fringe bitmaps respect alpha-background (this patch). --]
[-- Type: image/png, Size: 28330 bytes --]

             reply	other threads:[~2024-03-13 19:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 19:13 Nate Sandy [this message]
2024-03-18 14:02 ` bug#69782: [PATCH] Fringe bitmaps should respect alpha-background Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-19 13:01   ` Nate Sandy
2024-03-19 14:20     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]       ` <87ttl114bb.fsf@posteo.de>
     [not found]         ` <87v85hoyqq.fsf@yahoo.com>
     [not found]           ` <87il1h9ebb.fsf@posteo.de>
     [not found]             ` <87jzlwpfny.fsf@yahoo.com>
     [not found]               ` <87il1gaq5n.fsf@posteo.de>
2024-03-21 13:23                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-21 19:20                   ` Nathanael Sandy
2024-03-22  0:39                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-22  8:07                       ` Nate Sandy
2024-03-30  7:07                         ` Eli Zaretskii
2024-03-30  7:26                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30  9:52 ` Nate Sandy
2024-04-13  7:56   ` Eli Zaretskii
2024-04-13 12:02     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13 15:47       ` Nate Sandy
2024-04-14  1:00         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 11:01           ` Nate Sandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edcex7vl.fsf@posteo.de \
    --to=nsan@posteo.de \
    --cc=69782@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.