From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Help writing a patch to allow transparent backgrounds? Date: Tue, 9 Feb 2016 10:22:38 -0500 Message-ID: <56BA043E.1050305@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E8cp8B2o3s8OUPDd0BCKKpQDqRQpowWXJ" X-Trace: ger.gmane.org 1455031382 11998 80.91.229.3 (9 Feb 2016 15:23:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 15:23:02 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 09 16:22:53 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aTA7v-0006Zy-66 for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 16:22:51 +0100 Original-Received: from localhost ([::1]:56989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTA7u-0001YD-Fy for ged-emacs-devel@m.gmane.org; Tue, 09 Feb 2016 10:22:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTA7p-0001Y3-Se for emacs-devel@gnu.org; Tue, 09 Feb 2016 10:22:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTA7m-0005W3-E0 for emacs-devel@gnu.org; Tue, 09 Feb 2016 10:22:45 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.131]:54838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTA7m-0005Vu-4N for emacs-devel@gnu.org; Tue, 09 Feb 2016 10:22:42 -0500 Original-Received: from [128.30.9.77] ([128.30.9.77]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0Lq1p2-1Zpii03EtU-00dkHg for ; Tue, 09 Feb 2016 16:22:40 +0100 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 X-Provags-ID: V03:K0:xCnTURHD/GK5UsLWxwaExinOh2Fvi8LbYM6RxOBoQcZtJ7D+/77 69SBF1dJnZDSRiV84q+aibFzyFuCtMIhiZvrYzEJ0phUN8Ueu/Hu3WXZxBKLyjA8p0756QA /LM5zgpGiZqANSa/EUP0VJ6AidNSv3pNaJ7SnSYY0Uv6tkUO6vgdGEsjMoKLb0yr1GXONgR Wy+tvThf7tPzomZuLyXuQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:NVZwhNEFbY4=:SAyrHd6zini7rYjTsWl+qu UVDfjwv8Jf31C3xSd3uyuZgt+OWriepMT5yaHBqRl19FEbomtcd23WdDkONqBXwQTbCWgg9Kx GjL2kynYjAc1eXKo8XAjNOkjwHJVNsFMaiIsXoRmYQr4kezmH85RRkf4JSKpG8AW6mhUgUK0y TuKrat173pqmn6XRBR8HX4OxIPibTtN0w/vJ6FUScZeiCVt0FhylX8BDIa2SfmWDp5lXWLpY2 Po8/yXTVShRVEVS+FlvEbqmETbaXeATc0yYi/9ufk759aUkT2wmsFsfg/C8iF6hNkSQNINDIQ LaSv0rw5HjqvEE5PprwI9/28JnQKW+ZtZyNXMFMmoFrmvZhJeyiwLLtns/C+OuyrzAC7drJ5P hm/jMCCDdOg0xNjUUtiO2c7S1ZQKWlbWzU4x2rJ7/oCqviB/8pBKKU17UW/D+JOLVEgtX35Jc 4YULZMD2IlnVPbom/dFXRolW1O6SQDyJzafDGMMq3LMqmOIGOTaDd8ZF+s+G5SU2vj4gmwGIl wn4aC/BQtNYOL131fp5AcKVzD8kIONgExuq6iOejcs3+k6o1Xks9B2TKSI6GloSr+ybjlj6V/ pglz6M7CrRd9o6OSoJDHlZmfk56qn42IpLh+/OsFp++ISBIzf4YtpXwmVkF4s5G8jUJ4g+Or7 D5eJ9QsBuLg7EVOIPQjl/DCE4B89/O9bPXdtjXcO51CVDWV2zfMj0wXWMoq1jshbHJdI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199602 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E8cp8B2o3s8OUPDd0BCKKpQDqRQpowWXJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, The only way to get transparency at the moment seems to be with the 'alph= a frame parameter. Unfortunately this makes the whole frame transparent, = instead of just the background. I'd like to make Emacs only draw text to = the screen, without painting a background. I'm on Linux with Gtk3. I expect that this would require changing the way the background is paint= ed, and changing the way faces are drawn to not add a solid background. There are examples online: * Two StackOverflow questions: * https://stackoverflow.com/questions/16832581/how-to-make-a-gtkwindo= w-background-transparent-on-linux * https://stackoverflow.com/questions/22940588/how-do-i-really-make-a= -gtk-3-gtklayout-transparent-draw-theme-background * A patch to implement this feature in Nemo: * https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-2= 0131230/1165217.html * Another patch: * https://github.com/IgnorantGuru/spacefm/commit/5e4e148a2e1cf962fdf7= dbc776d8d09ad110dbd7 * https://github.com/IgnorantGuru/spacefm/issues/269 It's not clear to me how to apply the ideas from these pages. I tried two= sets of modifications: * In gtkutil.c (xg_set_widget_bg (struct frame *f, GtkWidget *w, unsigned= long pixel)), changing bg.alpha =3D 1.0; to bg.alpha =3D 0.0; * In xterm.c (x_set_cr_source_with_gc_background (struct frame *f, GC gc)= ), changing cairo_set_source_rgb (FRAME_CR_CONTEXT (f), color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); to cairo_set_source_rgba (FRAME_CR_CONTEXT (f), color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0, 0= =2E0); and compiling with --with-cairo Both of these changes had the same effect: the background isn't redrawn a= nymore. The contents of the desktop (behind the Emacs frame) are captured= when the frame is created, but never updated after that; instead, whatev= er gets painted there remains there. Thanks for the help! Cl=C3=A9ment. --E8cp8B2o3s8OUPDd0BCKKpQDqRQpowWXJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWugQ+AAoJEPqg+cTm90wjEnYP/2QlQSYJ7S31fxmyJBZ8+j7s oNfupcEB/2rGAlvaT5I5x+uUoiBhLdvkvTSA7AFZvDeRFGZ26Mo5x272n69n+wUQ YXU67ZRyYP+L+SsmRcgal4dHSOeoKxqsFIyH/mr2sAvLK9s3MQZKz4dRV1Uf3oJX fk2tnCgQWf3AuF+WioT7DpctRdL96rAys2mG0vrljhxxzTQbUJ+xGO5jtcxq3ePy BNiAEoQY5HjgolVrjDCsSYGcUtJWVQlfaFZ1ejz9W0vz52v3OWYsKFzaTvZLZQ5q 9ir1nMeq9mfKw/uGts1MqMdp7zelsKFVv3ubCiqlyax/Z2H7Mqxj/7WyOEXx4Qe1 Oy+76Qu7a18Rq/BEfQX9IbG8R0mmC6FC05QHs4uVWDI7DGHDlZbZBRWnkNPDeibM RbmhGFOfn3BFvR338roN4DmvHRgSDsjFY/w1EVtQupdv2DZ0GjbZXfmGQZjosnLl Vpltyrhalg/cskgblUtj36L5nfO/UwpFnn9bQ4rfmCwq/1XYpw0ns9XIlsA2+KcE QrGU1WYKhkqqbstuMF2VgxUsZTNjKO+C40HxGUg+Kkj9c1UY8+C6uKNOb7Qadcvp 6CCSVb166UTgzne8F94JiPodHIdF4q3CnF6JK/xJ57LHnC+S8n/laH/7v2wK8dnZ vqwFRzXAsHs1y0vckM0Y =yxp1 -----END PGP SIGNATURE----- --E8cp8B2o3s8OUPDd0BCKKpQDqRQpowWXJ--