GNU bug report logs -
#70697
30.0.50; Frame parameter alpha-background is ignored for fringe bitmaps & internal borders
Previous Next
Reported by: Aleksandar Dimitrov <mail <at> aleks.bg>
Date: Wed, 1 May 2024 12:02: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 #11 received at 70697 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Aleksandar Dimitrov <mail <at> aleks.bg>
>> Date: Wed, 01 May 2024 12:52:58 +0200
>>
>> Hi all,
>>
>> Runinng in any compositing window manager (this includes Wayland with a
>> PGTK build of Emacs, but also X without PGTK), the frame parameter
>> alpha-background is ignored for at least
>>
>> - fringe bitmaps
>> - insets drawn with internal-border-width
>>
>> The resulting visual effect is quite jarring, and makes both of these
>> difficult to use together with transparency.
>>
>> Here's a small emacs -Q script to exhibit the problem:
>>
>> #+begin_src emacs-lisp
>>
>> ;; Turn off scroll bars to make the bugs more visible.
>> (scroll-bar-mode -1)
>>
>> ;; set transparency & internal border width.
>> ;; Note how the internal border is going to be drawn in a solid white colour
>> ;; and will ignore the alpha value.
>> (modify-all-frames-parameters '((alpha-background . 50)
>> (internal-border-width . 20)))
>>
>> (define-fringe-bitmap 'test-bitmap
>> (vector (expt 2 15)) nil 16 '(top t))
>>
>> ;; Define a face for the fringe that has a different background colour, to
>> ;; more easily discern the fringe bitmap bug from the internal border bug.
>> (make-face 'test-face)
>> (set-face-attribute 'test-face nil :background "pink")
>>
>> ;; Apply a fringe bitmap to all lines in the current buffer. Note how the fringe
>> ;; bitmap is monochrome, but the background colour ignores the global alpha value.
>> (defun apply-fringe-bitmap ()
>> "Apply a fringe bitmap to the current buffer to exhibit the transparency bug."
>> (add-text-properties
>> (point-min) (point-max)
>> '(wrap-prefix
>> #(" " 0 1 (display (left-fringe test-bitmap test-face)))
>> line-prefix
>> #(" " 0 1 (display (left-fringe test-bitmap test-face))))))
>>
>> (add-hook 'emacs-startup-hook #'apply-fringe-bitmap)
>>
>> #+end_src
>>
>>
>> And here's how it looks like: https://aleks.bg/emacs-bug.png
>> (that's my personal home page, not an image hoster.)
>>
>> I would expect the white border around the frame to also be transparent,
>> and the fringe, too.
>
> Po Lu, any comments or ideas about this?
This has been previously reported. As I've stated on those occasions
and numerous others, the internal border is a _border_, a natural
component of a frame's foreground that should not be affected by its
background transparency properties.
As regards fringe bitmaps, they respond to alpha-background on the
XRender builds. This (untested) patch might extend this to Cairo
builds:
diff --git a/src/xterm.c b/src/xterm.c
index 33ef18d8da5..4fe52bc6bf0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6293,7 +6293,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);
}
This bug report was last modified 143 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.