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#53457: 29.0.50; pgtk: [Request] Expose GtkSettings to emacs Date: Tue, 25 Jan 2022 19:52:39 +0800 Message-ID: <8735lcnibc.fsf@yahoo.com> References: <875yqbtelb.fsf@yahoo.com> <87sftfrwyr.fsf@yahoo.com> <7ryBJGbLNundVwb81pO54APmKbZt-N_2vSFDHa5AgSKH7D2OvGmU-hvgtlKsNT1XxE4yCVzTI74QNro3or4CgYhOE3jaBIthrEZkA16YF-8=@protonmail.com> <877daonuvh.fsf@yahoo.com> <6om0eP0E-JpYbTwYkdOEPRiA3CJhGst7ImtBzgPqJHeCsaWZbRWBh9H3R0sU7IgXYmhJoB9ic8E6lF12_VqAd76aPV6REbzUd8I6Mp7bka8=@protonmail.com> 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="5107"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: 53457@debbugs.gnu.org To: Maximiliano Sandoval Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 25 12:57:19 2022 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 1nCKRr-0001EV-BG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 12:57:19 +0100 Original-Received: from localhost ([::1]:54310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCKRq-0003et-0L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 06:57:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCKNp-0007e9-JD for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 06:53:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCKNi-00065n-AB for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 06:53:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCKNi-0005qV-7l for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 06:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jan 2022 11:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53457 X-GNU-PR-Package: emacs Original-Received: via spool by 53457-submit@debbugs.gnu.org id=B53457.164311157622460 (code B ref 53457); Tue, 25 Jan 2022 11:53:02 +0000 Original-Received: (at 53457) by debbugs.gnu.org; 25 Jan 2022 11:52:56 +0000 Original-Received: from localhost ([127.0.0.1]:47142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCKNb-0005qA-Qx for submit@debbugs.gnu.org; Tue, 25 Jan 2022 06:52:56 -0500 Original-Received: from sonic309-20.consmr.mail.ne1.yahoo.com ([66.163.184.146]:33217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCKNY-0005ps-Ta for 53457@debbugs.gnu.org; Tue, 25 Jan 2022 06:52:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643111566; bh=0sr3vpW+T/tG8OfsvaP/uoGCicvZy/whoQD23AyBX4U=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=OsQ4tvKUu9PNqFkUjLTVAj7goWwW+XbNuOqNCTjv557JUW3dDe8/Uk1+ZNEf3jMS8RaI+RY1poLG2LLIDh5lj+zwDTKUAOppTR6oPZ+uks3K/MGr7/iK0eeHF8XqBIUdzSkoL+YKQ6xTD7fFiN/Q8c1LVh2bwwX05fiYQNrSH2+Iw/f7AZQrWkn/02xLEOLiexen2yLHnB/Br+OyHXxOCKrQBp3Y6fjGJUsU1rdDtEBx6FNu47j9Y+ZDtxJzI9jbBKzK/QIe01K90xlO/rqhL6ORA2Fq1LN4DAXe/1EDQ978/gnFrwWV6/elZZcl/cP3pqV+U1/x9sANBWq6bJzxBA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1643111566; bh=DOngeVA8imnZMa57oGBGMcS8s6oO3fsGguGQ5727vDE=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oFMsUeKVFNzcDEMEF5BhO4dTOzUp1ieMkmJakQ6Rjj2HtBkkG2Uym9m6F3ZONsDFpKH7BKjWg6GivCoPGyebIbghupDiuHpA+Vr6spuB5NSXb0emjmLuQYrJVZOGcvH2+KHSxd1XI9g2KxxTiBaIR+MqYxI9PSl/9jflqwJgQ4XxEto8FGuc2x35VdDmua5GiXdmX55hqoaNgdGyCVZPmRZFZdTpKKgjGfLc17siu6qFX9hTWcZVAVdO/XudqEE44QDWToIpJstNHLlyBQnVQIMpAuK6pftq28VftihJdqA2igfCQsx0GF/IkM1HIzIiZHdMdrYrnQki7NplDibWBg== X-YMail-OSG: 2S3iMdQVM1lvmSKsCTt3Cml1pdoi6ZXmwZvFUoY1FCLYENsJ34hxPYFzEAyUOD4 OSmB_EB5YVv7wZdNxBErGSY.UTnNnx4fgCfj3pe4HxVBvfUxyAGIbqDe5iGePWe8x0_7a3GVORt4 3wiIFrHbSYO3reC5GpIWQs9qi0M60La7USt.618MJGFFAOFeysXwQxWzoaPdMn.IVHYWYRANWXAX fGRZjK.c.p376YTmjKZBp2z8ER6FRwIEfhQB_lU1ho_.GWOvWIRriuHyEcnFl7p9OIfoxxIfD3ti M79uYmalYKja66xEoqlwZeH8.dqPrtzA1my5TmMz8ZppayR3v7DTlv4pSXVcjsidEzD8rc5ovByw UhBabJtNfkauRyF9aug0HQQwMD.Z04kSJYYlzyvHpfbObjeeauoUmfT5dAFDqD8EFM4F5ubFvTq. uUNg8YeKvlhMpV4Uv54P9MmAJq4jVC2wB_QF.G.Wnb3DO4veyfxfXybc6i.y_mL9lUJyJAO4Ja0W 0QbjXukNZ_D.pckV_n6JHuKfQlO66SxPb4ZNsdfan17nEQQgBuBbsjdPmrn4PHLuBtXci.qQR4oz Pj.SGht4YvMmDwfWwWcwLs57kO1qO15jvDbs9n5LB5F_k61YOPCwMPacsetLzcUzlqRgSwJ_hWcj m0PcqwhZrxaSomEfSxUlnMU3T3a46aCLXlEcpDhmkNVLayYhF8ehMCkePMIjSWF50yDCaBhVCbwc fHp3.ZqW_JPxnGh9.kqZxXmAShWNxQxb998xO4pZzPGcvRxXeKCHR74oZ0PFXEeNXj4R7c1zz9pn YLahrSC.eqTB0mMkNItFVZB1FUsU4iMYY78DSwoU6d X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Tue, 25 Jan 2022 11:52:46 +0000 Original-Received: by kubenode519.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 41971276843660129cf748bae9850eac; Tue, 25 Jan 2022 11:52:43 +0000 (UTC) In-Reply-To: <6om0eP0E-JpYbTwYkdOEPRiA3CJhGst7ImtBzgPqJHeCsaWZbRWBh9H3R0sU7IgXYmhJoB9ic8E6lF12_VqAd76aPV6REbzUd8I6Mp7bka8=@protonmail.com> (Maximiliano Sandoval's message of "Tue, 25 Jan 2022 11:04:36 +0000") X-Mailer: WebService/1.1.19615 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" Xref: news.gmane.io gmane.emacs.bugs:225156 Archived-At: Maximiliano Sandoval writes: > That works for me, but I have to stress out that this is not GNOME > specific. Such a patch would only require > > ``` > hdy_init (); > hdy_style_manager_set_color_scheme (hdy_style_manager_get_default (), > HDY_COLOR_SCHEME_PREFER_LIGHT); > ``` > > after `gtk_init ()` is called to opt-in into following the user > preference. Note that this requires libhandy >= 1.5, meaning that > there are no stable releases that support this yet, we will have one > before GNOME 42 in march. No worries, we can wait until it is released this March to add such an option. > If you are using Adwaita-dark, whatever color scheme you declare in > the xdg-desktop-portal will be override by it (and thus ignored). The > reason Adwaita-dark is broken is because apps cannot tell that they > are in a dark mode, which leads to broken visuals, e.g. in gedit the > highlight for the current line is white, making text invisible in > Adwaita-dark. That can be remedied by selecting a different color theme in gedit's preferences, I think. > How does this affect Emacs? For example you might want to sync emacs' > theme with the headerbar stylesheet, and without hacks it is not > possible to tell if emacs is using a stylesheet that correspond to a > dark mode. The only way this is possible is by reading the xdg backed > preference and for doing so, it is desirable to have emacs being able > to declare its own GTK theme. There is no "headerbar stylesheet" we control, not even on PGTK. GTK only draws decorations in our usage when none are available from the display server and/or window manager, so it isn't right for us to advertise a feature for "changing the window decoration color" that doesn't work as such. > Those options are there only to avoid breakage with existing setups > and they are not going away as you point out, that does not mean they > are *supported*. The only supported way to tell a GTK 3 app that it > should use a dark mode stylesheet is via the > `gtk-application-prefer-dark-theme` setting. No, the gsettings setting is explictly supported inside GTK code, and is not a by-product of trying to not break existing setups. Programs which want to follow the new XDG preference for preferring dark stylesheets should use libadwatia or libhandy. A configuration option for Emacs to use that is the right way forward, so I suggest any interested party to begin hacking on that now. Thanks.