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#57639: [PATCH] Add new command 'toggle-theme' Date: Mon, 12 Sep 2022 21:11:48 +0800 Message-ID: <871qsg4u0b.fsf@yahoo.com> References: <875yhzmz25.fsf@posteo.net> <875yhzmj50.fsf@gnus.org> <875yhzl3a1.fsf@posteo.net> <87fsh25bso.fsf@gnus.org> <871qsil3jm.fsf@posteo.net> <87fsgygo7c.fsf@gnus.org> <87a676jfx2.fsf@posteo.net> <87bkrmdt46.fsf@gnus.org> <8735cxpx2r.fsf@posteo.net> <871qsgc390.fsf@gnus.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="16504"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Philip Kaludercic , 57639@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 12 15:21:04 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 1oXjN2-0003zv-2i for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 15:21:04 +0200 Original-Received: from localhost ([::1]:36148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXjN1-00020G-2j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 09:21:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXjFK-0003E7-C5 for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:13:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXjFG-0005Q1-B2 for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:13:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXjFG-0006CK-0C for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Sep 2022 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57639-submit@debbugs.gnu.org id=B57639.166298832823745 (code B ref 57639); Mon, 12 Sep 2022 13:13:01 +0000 Original-Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 13:12:08 +0000 Original-Received: from localhost ([127.0.0.1]:44584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjEO-0006Au-4Y for submit@debbugs.gnu.org; Mon, 12 Sep 2022 09:12:08 -0400 Original-Received: from sonic317-32.consmr.mail.ne1.yahoo.com ([66.163.184.43]:39690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjEJ-0006AM-4d for 57639@debbugs.gnu.org; Mon, 12 Sep 2022 09:12:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1662988316; bh=TFUvESNbNedaL/hDzC8xHSWi5MhUPQ0VgJUOj6xJ/Jo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=p2BnD9Hs+h0vxIuDZEQdCrepTbR84ySe+LS4yCoQZ3qjqWbRx959cXSpcbSkjUIc2znRgBb4pzNmgF5EXdFufxEodCi5hn2H9eombtRlQ8CP8TlIUXnsoWra+So40jaAo8boJivI+8x9f6iV4SvDnfNm0frur+8Zz5fMO6P4uXSVPsZoMqqPZgORAJyPsIk5VB5aZO0+lRircRdxCmWPjkl8BDbTLG8wwIMlxr/cwEjc6CGXdWGRHbaYoA/c/Hevdfk1ZxmsA42ceuaVhsiia6vUXLVlAs2v6CyNc2NkL2LRQhQehhvb5Vxcxe9KgCBREnBaqICRM6EfzDMLLA0eGw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1662988316; bh=b2z8rU3GXtpneljW+50qxWiOsSyJpr2FvI+iOxL8hli=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=QDzINrOR0CqbX4LQGBvAy/LowBEzZpNLqRd6/8F/l6w3Ik9qz2S9v907ydHbhxulMGPGIEg2prq1tznk6x9Rg24oRlFRmy8w/oLlZIGPqcw9zTKGsTmsWuR2YkhbGiBoGvfAf9knS8ZywooLhaf8WOvDLkSmA5vhZtXKvP4PQgClvHz2WGLgQ4SzvJL867VArqGSEAqOwFqmOsKu7Ii9Lnva6cN9M/IPoXl63sLA/yXb3PALEKnhIW87qXgiri08g8z9+HLFBhwAEkiWrBuabV1bdfmfS8xmwpeVVX8w4SSf0xaNMbxtrIUBVRwQiP++gGU8fyIOiI6SAmIi4aFvQA== X-YMail-OSG: 0BUI_AMVM1kEN0fuGO.LpAakjI6auGUmkmdGXJ13qiG4x4E9MuOumDD8FCAkESJ Hm8o.R0BltnoVWhGZUdRxDQ_nx08TOPseciBce9.ZfFhTBTDDNvsGqI4Jd3WMKzYhwNsML_35r0N _jNGsm1Mps5J3jEQpxR9dGFWXj1ZPvESN1O0OcBGhV_22ZrVxFK.FHR.XxkWn9DXqU44ADMoJ3oP oD5hEIdOMOkEAQpgjX_uRwq71oCW1N2fyC5Zmm7WtpmeJibyIbiyxLtt9EiaLoTqy7FcYGd2n8bj F3kfUKb.qT7sP7z_E2T6NJ5pt4r1PQxGbbXHu7iUa.TVxmkGQK9oxPGw8VlYLzLf2QC1suXSz4xU bDAzK88575ZwOVAkrhn54tUlilS4MvQHrytEA9RNq4P06GJo6_yyvMgydaV0giEGonyurMo5FVMQ VQeJg0bFKocX_z5wstJdL8Om7rIYMNxvqwiYKm7g5YEgl0lsZV9Y5gR639KV3KM3rvAxvYXMqEyU B7tyXYBV0vw8y58sHXvypUFa8Nx4Txq3g84D7YXqyxr5JUCKdPuasdX96iLVVz6aSwnJo0xJDCRv 7RBbfsGnOUmZhfB9fm4c0EUzzaigsR.O684GP7aeRnjJmBkwvaPDk6eh7KIMSDrOvWtz40cJCQJ0 QlOWxjCDgETFJ9BfwFuMTVdvtDsFPzipamVV.JHGf8sGqTFjs0j401uC2ChpeEFqDNbvBIP11H8E nfReamMt.7biv_xdI71k8GJnpGCbnyeyXGMm4co4tqqB3lDXeg0UpI03E8pwJjtlb.9p9tCn1Oqu qdaPKtm71yk2miPMd4pqMk5oatNO2aItqxQTHrB6_6 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Mon, 12 Sep 2022 13:11:56 +0000 Original-Received: by hermes--canary-production-sg3-6bb8946c47-n8gf6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID db3308c25e5d1c00bc98b0797275c1fd; Mon, 12 Sep 2022 13:11:53 +0000 (UTC) In-Reply-To: <871qsgc390.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 12 Sep 2022 12:10:19 +0200") X-Mailer: WebService/1.1.20612 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:242272 Archived-At: Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >>> I thought we already had support for this under Gtk? But I may be >>> misremembering. >> >> Am I reading it correctly that `style_changed_cb' in gtkutils.c would be >> a place to start looking for this functionality? > > Ah, yes, I think that's the one... Po Lu probably know more about this; > added to the CCs. What exactly is the wanted feature? If it's automatically switching between dark and light themes, then style_changed_cb is probably not the right place. It's mostly vestigial code from when we used to update the region face along with the GTK stylesheet. Instead, TRT used to be to listen for changes to the `gtk-application-prefer-dark-theme' property of the GtkSettings object. However, that has been superseeded by a dbus based interface in recent versions of GNOME. I do not understand the details, but it seems like it could be implemented in Lisp: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings