From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Sv: Sv: Sv: Support for background transparency Date: Fri, 21 Jan 2022 08:59:01 +0800 Message-ID: <874k5x29be.fsf@yahoo.com> References: <87wnlnptf2.fsf@gnus.org> <83h7bwybeg.fsf@gnu.org> <87y24t1ed1.fsf@gnus.org> <87wniv2pp8.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36425"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: "emacs-devel@gnu.org" To: =?utf-8?Q?H=C3=A5kon?= Flatval Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 21 02:49:57 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nAj3t-0009Is-4b for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jan 2022 02:49:57 +0100 Original-Received: from localhost ([::1]:55106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAj3s-00044J-6k for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jan 2022 20:49:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAiGo-00088Y-3i for emacs-devel@gnu.org; Thu, 20 Jan 2022 19:59:15 -0500 Original-Received: from sonic311-25.consmr.mail.ne1.yahoo.com ([66.163.188.206]:38717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAiGm-0001Sx-9Y for emacs-devel@gnu.org; Thu, 20 Jan 2022 19:59:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1642726750; bh=8QMrtFlGahCitDi3VUqHQR/qOWNvYzkSF/Liq9DV4rQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=BNL0SZ1WQjC7Flq3EzYNf1FXwd1FUIgPr++h/DXREArvDTR3UCN/M1XEfanK94KOd7h5zJSJQ9A/3Eov1tXkNI2JTzePPdIVCwWqFtrixCkAFUjk4cbb35URtz13Czgmfn/frHvbfj+DXg80h6wIwuM5uI+vyoCLq/UpS3GUOhBshGWkOARHZMH8/kw8WK4eTrM4ip+N5qL+zf2oXiR0lSYyRFlUgmUagY5KGgI4ly0KGBy229c9K+EPWwjsvLmLKjbCiQoc8599xEhVvr0Q0QOT7nNBGOT+OLLaIQpIHUgWtrxoWcwFJseq5D+Vks/ZZFpXwHH8NRU2CvQO4tTmNg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1642726750; bh=+RVjw9LGCQKUJuEypCWK8V0BKvLIFym04ZAdv0rmS0U=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=mx0x7PbFZ+lXAMhYtU4Ty7ZMuiicNgwdg8CE7+VtPC32JKujmA3ue6U5fqUy1800G4jk7ODn59/P3BQZWMD7BBCSjjv1O4FCt9eQYCopuv7J7B01M63Q/JhOxI2iXe9YFB4L4kqzGKk6fVsGXZIVUpedbGQLSil7MKplGXa+bTfT6nkCcSEJeUnjVj+XQqw94gjPZbbSKw7m3bZ3F8VovsNPZ6A4TxFZWtDCG/Rf+QRuTcC5611ggihX30/WOcVs9dUMtrmdYPWjaMZyT789761DrkwKebuhaDCaZXZuDZ3Pcgi6ZCbhm0pPu4PqFT5j6DSEqvohDXM42Hy2SB6ELg== X-YMail-OSG: 8eATibYVM1m_JVCoWIWjoifZCw80iZbVugRwPguZOPB7CX5Yod4vSE7CHlS_BFc 4zpYJhkRIMtHRw7ws_TPotXVFCeimoEHtRPZUdN6yQlFS0WkjVyoblsocx9iseHZDa_vSD4W7_wu _P9jmy7wmvJqt6m2Kz.br5lo91ioLcjkir9E__S6UKNzJndeqYTQeDxDNcDeBiN3wvvP4wnZMSHV Bu4dMyuUkER3xbnUohpJvIHLGxxB1RpfonToFl.W4TYoMCxnA4fg0CrV8eI.34o6_FzlMm2K.PLN rbRWDJGV58w_i8tU.HmGFqIX5ouDmTUjHAnZyJ2bI4LvkMwQlYXHrnw11tAVXvEZQgpvsuyg5feC TD.l13oVFPfpuGZhXB7.54YtA1VjD8.Z1CkpT9TJBc6ZC2eTnqalKiEKj6vS921UCCvLLJldppss llLs_wEgKeZ1MaaECCpsvGPDzhu3Swvm9Op8XbiEFupYDIdNlxQC9mCmpf9Vx9_QMt0qnkKUq1R0 FenUZ0jq1j04G1xT9NUXB1OlIZfTcOEcZRiPsNKJuU0Iv_iU.O5ZLE3DIDiavqBVitK.ILK9V2Oy 1hfc9pTYkpBB_l0c0bi3YEcyO5eLTp4sGyxLdFWF7r6KWl1GJnvvyAohRxUgDmQ7bLuOe5SHgBkk _muf2j_8f.8mEM177B3bSAzV3iH4kzvQY7ps3Ai3PN2yomp5RF56rhaDmgUDGYFRyfwjK26iZ5_y X0wTx_0zDNjHWtxntqWDzSci5_Wmfn_o2Mi9HakXSI4sAw33dEslI.K2Y9uFBSMn8pwWOr_Yr4pB W9Zxvlw0i2p8qFWK4CzpbXtK4bqdo1.XwiBffNV1J7 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Fri, 21 Jan 2022 00:59:10 +0000 Original-Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 9c7d06f81cd020192d4f5e82debdce5d; Fri, 21 Jan 2022 00:59:05 +0000 (UTC) In-Reply-To: (=?utf-8?Q?=22H=C3=A5kon?= Flatval"'s message of "Thu, 20 Jan 2022 19:52:33 +0000") X-Mailer: WebService/1.1.19615 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.188.206; envelope-from=luangruo@yahoo.com; helo=sonic311-25.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:285072 Archived-At: H=C3=A5kon Flatval writes: > I now run a check on the bit depth of the visual in the > x_set_cr_source_with_gc_background function. I'm not too happy about > this solution, as it involves two more calls to the X API, but perhaps > it is acceptable. You could just check dpyinfo->n_planes, which should suffice (and avoid the calls to `XGetVisualInfo'). > + if (f->alpha_background < 1.0 && depth =3D=3D 32) { > + cairo_set_source_rgba (FRAME_CR_CONTEXT (f), color.red / 65535.0, > + color.green / 65535.0, color.blue / 65535.0, = f->alpha_background); > + > + cairo_set_operator (FRAME_CR_CONTEXT (f), CAIRO_OPERATOR_SOURCE); > + } else { > + cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0, > + color.green / 65535.0, color.blue / 65535.0); > + } This coding style is not what we use in Emacs. You can look at the surrounding code and https://www.gnu.org/prep/standards/standards.html#Formatting for more details on how such braces should be formatted. > I have primarily considered GTK and Cairo when implementing > this. Support for other build configurations do not work currently. Would you mind if I implemented that support instead? > It will require additional treatment of e.g. the LUCID libs. I have > looked a bit on such builds on the side, but currently have not shaped > a plan to finish it. The Xt builds are unlikely to ever work with this, since I couldn't find a way to create the shell widget with a 32 bit visual, and we can only draw into a child window (which isn't composited) on those builds anyway. But I do want the non-Cairo GTK and no-toolkit builds to work. > The preprocessor statements are to ensure nothing else is screwed up > when using 32-bit visuals. Which preprocessor statements are you referring to? Aside from that, I'm happy now. Thanks for working on this often requested (and thus important) feature.