all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69782: [PATCH] Fringe bitmaps should respect alpha-background
@ 2024-03-13 19:13 Nate Sandy
  2024-03-18 14:02 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-03-30  9:52 ` Nate Sandy
  0 siblings, 2 replies; 16+ messages in thread
From: Nate Sandy @ 2024-03-13 19:13 UTC (permalink / raw)
  To: 69782

[-- 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 --]

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-04-14 11:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 19:13 bug#69782: [PATCH] Fringe bitmaps should respect alpha-background Nate Sandy
2024-03-18 14:02 ` 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

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.