From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70697: 30.0.50; Frame parameter alpha-background is ignored for fringe bitmaps & internal borders Date: Thu, 09 May 2024 16:03:20 +0800 Message-ID: <875xvn2z07.fsf@yahoo.com> References: <871q6liz1x.fsf@aleks.bg> <86ikzn77h5.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14390"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Aleksandar Dimitrov , 70697@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 09 10:04:44 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s4ylg-0003h1-2s for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 May 2024 10:04:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4yla-0003OZ-JS; Thu, 09 May 2024 04:04:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4ylY-0003OH-UL for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 04:04:36 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4ylX-0004zj-T9 for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 04:04:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s4ylx-0004hM-Nj for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 04:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 May 2024 08:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70697 X-GNU-PR-Package: emacs Original-Received: via spool by 70697-submit@debbugs.gnu.org id=B70697.171524186418051 (code B ref 70697); Thu, 09 May 2024 08:05:01 +0000 Original-Received: (at 70697) by debbugs.gnu.org; 9 May 2024 08:04:24 +0000 Original-Received: from localhost ([127.0.0.1]:53868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4ylM-0004h5-1H for submit@debbugs.gnu.org; Thu, 09 May 2024 04:04:24 -0400 Original-Received: from sonic303-20.consmr.mail.ne1.yahoo.com ([66.163.188.146]:43256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4ylJ-0004gx-QC for 70697@debbugs.gnu.org; Thu, 09 May 2024 04:04:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1715241830; bh=Ngb/ttRSg9MloA/4amemy+IsJnx9uMD6bOfjUru/HO8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Qthl+Hd8SewD8EyDqVPfdCLOm71AC6qPFjalEwX2l9+Q/LxXMTKBIq5FtzHKPvAteabE4f474jGvH2pAx1AoIWQ8pT2Oa49NYUz1dUgZQXOky21RZad/8GQJuizkYX2HCqueljYRqc8TXF6rcTGOXNqq6pwB4v6AtZ1jiWF6yH53fWWIo7ZbUGUe2F6W8UarlnCwxJTeEY9j86cmug6ckANZDSQxGZct3Lz66xnaaHzOIar9gm7BjlH0Pp7fKogIq7UkCKMU4XfrGpqEiE4RuydjhnebGfmDhIQf1fh8OCkbjPYBELr9kNacbZ0GHfHgGslFjjaYTgvnNv0srRcPIw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1715241830; bh=bTvIa9bwGM+rAizzfdy1knzXU5bKRn+TJ/6j4uFr9gX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=osG1H1v2+YeNdMQnfMk4JBzWKxB+eGsd2Pg4jVuSbH6Dz9OingkdWsuTryATkF+6QsEMBpR7aSb5PxoJLlsnPBPlGrh3M+1CkDgaaHAZuXBJuiinLLdMchIVhwH4CIM4LrrbZfy1rREX9xlfbhBPHVJ/JdQTEY+0fT5KbvG28xqLWFhJsnaOdlFUB3WwafpAOn/hjNWVtU5VhL7Io4JYvuU5q/dhOZZ2uw4ujbT5a9Ac5Qg+mufzKGdpkKkrlKjXCYvdwanPwUxdgW0LpCJ2IGI77RldZ9blCO+FWMWB+/MISBlDSO8TALUgrCX/TKw8SOVF6qqeTktkdPrLGjK4sw== X-YMail-OSG: gFjV7pMVM1m2CGIax.86KG2zqMos6wujY_k9zLZ5U3SmfwtVhsfan1CaAclJQUF sArmEfnXHY_OSytc.oRgbx6t8MSqW2BnC88s5Qtwb7DygSikpBpTIFcpRonZcwpOurqaQlaz9RFz ycjdLRJZ0BbueChFkZMaU0CXpwGOZl3Us014nXmbp2Ol2NNXl7hNG.zdnlsfbuKe66r69GZ6F7zP tNJkxUReAvtRPjHb1Ewys6WNGnLoLO1NB6yUUbY53.tYj6NP9hDDnovtAItrr3E9RkexAmXw2BFz LSCOO_AenWori_tpi_tMUahKqgIsdlWDbVqiPHqFF8pbqiGs.X3e39IC.SnE_4a7guTPX9S70AT5 2M_PZba_uGhyiQK_JOyNwDC1ls.4FTq43WfjhHImXNge38bndeXNd9tMqFoQkT1NdcvCEifg7LBU pWdgrX2WyUjd19O8yZcmQOrvdNyirBznI2uL3RRj3LrcTRpERs0Do8f7LWS.EJFbAIV1Y5rnJA6E NNJZF9iioE5.i35PoW3F.AhUx_ygVJC6JtVx7X.lNDZTtRugYa.NLXZgzeDJfJzbzN5PQzGJFLae HhhuF7i9duR.gmhcbWcbh_YyC7iRYmXA_LvhK1Y3xbSmFo_ob.42YlaJg60kiiykFj8f_.T4oeHa z6cjm7V0.9Eh2_qWg06kvFDCAlAhpJN_KUI7yzhy1NdnYWnqg5WH.bPDaG4EHuHslAbZI8cljcqx licqa_7CZqBesXzOFDKPIWaNFS7iPvI3nhqxPtpRs.tQGW4m_vQn5QLQdoo8BtC_xxJcYM1levWI QBRRSb5bLbrveYFty6997zIxZ7oep5nDqnnNWAuXEE X-Sonic-MF: X-Sonic-ID: 7fd108db-4529-43d5-9d55-58c989db331c Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Thu, 9 May 2024 08:03:50 +0000 Original-Received: by hermes--production-sg3-6f9f87bd85-kf2q6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e68d56090cc632bd848392f2f5b753d1; Thu, 09 May 2024 08:03:46 +0000 (UTC) In-Reply-To: <86ikzn77h5.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 09 May 2024 10:46:46 +0300") X-Mailer: WebService/1.1.22321 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284741 Archived-At: Eli Zaretskii writes: >> From: Aleksandar Dimitrov >> 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); }