[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#69782: [PATCH] Fringe bitmaps should respect alpha-background
From: |
Nate Sandy |
Subject: |
bug#69782: [PATCH] Fringe bitmaps should respect alpha-background |
Date: |
Wed, 13 Mar 2024 19:13:34 +0000 |
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
>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
fringe-bitmap-current.png
Description: Fringe bitmaps don't respect alpha-background.
fringe-bitmap-respects-alpha-background.png
Description: Fringe bitmaps respect alpha-background (this patch).
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background,
Nate Sandy <=
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Po Lu, 2024/03/18
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Nate Sandy, 2024/03/19
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Po Lu, 2024/03/19
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Po Lu, 2024/03/21
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Nathanael Sandy, 2024/03/21
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Po Lu, 2024/03/21
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Nate Sandy, 2024/03/22
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Eli Zaretskii, 2024/03/30
- bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Po Lu, 2024/03/30
bug#69782: [PATCH] Fringe bitmaps should respect alpha-background, Nate Sandy, 2024/03/30