GNU bug report logs - #53458
[Request, Linux] Follow system dark mode user preference

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Maximiliano Sandoval <msandova@HIDDEN>; dated Sat, 22 Jan 2022 22:15:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 53458 <at> debbugs.gnu.org:


Received: (at 53458) by debbugs.gnu.org; 23 Jan 2022 13:15:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 23 08:15:14 2022
Received: from localhost ([127.0.0.1]:38865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBci9-0007KP-3z
	for submit <at> debbugs.gnu.org; Sun, 23 Jan 2022 08:15:14 -0500
Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]:34138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1nBci3-00077x-4M
 for 53458 <at> debbugs.gnu.org; Sun, 23 Jan 2022 08:15:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1642943700; bh=OwwNj7zE5PRzpSfEAvvTw9p//UIofK07W0NlxvdwvwI=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=nV+apFXHt0NyK5hAjyMCQ/RLekV0GuFpuSa2emDNKRp2fQrFLew8hGR6v50hsowHHjq+GWRqgIZWlGS9PWZw13frrOBUxcAIZ9oybcn4ANrekTmERKcw6cXbfkLSpItEOs14tYAZ3DgCot4NBNG9rvxKWxNPUYqOWTu57wVMq9C/0ju17EYmAjvO3m7XEKcu4xhqdBsYNcaSa9P7L617oPmhn3LQEnO0dTPmE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LblVCnicToKwnv
 fLMWwNn2Zf74eWuSVSNFTBObngKPAMEgJq8LMOwsISEiZGbwG0RIio.P4o5RB8Tthmu2qqYKYfQK
 PuRiD12olDheGT7mUB6MmumCeqYuaxq.erdMK9bUDp9AvaP2iZJe.J1lqtsE7oKUGXGBUSSIj7Bg
 PRLl.9pASTjWsxsZCHZ4eGhdJFXFkG_5rYFjRPxGJlgDvzvjcXYfejKE6_wYlEM71ZWsWWJVmFBF
 igQ.NbYG3mOfmXs6DttdoA90jOxCTKzDY7bqfWGdcALjnynl_5grlAG9m09ZKAYtXORRiixQ7caF
 claa_pCO5iUbTR976ZjfSS9M7ruhLEO2jkFjqlkmYQYpIxcWuPsNtmZ.gaVbaY7.YRRD2TYyZ4ea
 SESYTbFrQs.NP0ncqp2_Znu73ilwzqvmNzhpO2OhY_Iw5nkmbWALzccQcmBXiRwYaapL7RhES5xV
 U360l_11qTNNIGaNmdtAj3ndm35iL.yPYxl6jyM0tv0KeCtWaQBsRfkXrVV6X7gjIB4QUQdPZH4P
 kbgQptlRgg5n1_UI14V29aXsgmhnEc5G7Va3lFlTzaDWHYDjkFadt0FHgDZX7PXblrP3nJTSZzsd
 WNhZzCC3r17lFk1nYRxMOCtACHrgPJIvTmV6ZkvcdfCHfqAFVjqHw.WLPEBTOqPuUib2NapIuJZa
 iOkMnxjJ5Q3j54KecTrKTEAOPukE4OwFTrYYEOQw0CTn3v63rAUh8ONHr4xXiGmYD8fht1SSCuWY
 _nX3RltoWbx4AcDK9QYQspBPP_wdjacRc5C4ijlJWTauIi99xQDXz9Po-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic303.consmr.mail.ne1.yahoo.com with HTTP; Sun, 23 Jan 2022 13:15:00 +0000
Received: by kubenode511.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 9207bb49e36b1316986f66f2c56642f4; 
 Sun, 23 Jan 2022 13:14:55 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Rudolf Schlatte <rudi@HIDDEN>
Subject: Re: bug#53458: [Request, Linux] Follow system dark mode user
 preference
References: <3iRhN5EFJnIdFLuFt_CnYryIAZSjHpoq96ZkkxYkI1DJS4cNYRyGd18E92AH1lTjuEY75njusiICZbdF_AD0brAkLZ_9o9Gk435hsZbXiho=@protonmail.com>
 <87wnirryve.fsf@HIDDEN> <m18rv6k94b.fsf@HIDDEN>
Date: Sun, 23 Jan 2022 21:14:50 +0800
In-Reply-To: <m18rv6k94b.fsf@HIDDEN> (Rudolf Schlatte's message of
 "Sun, 23 Jan 2022 12:02:44 +0100")
Message-ID: <87k0eqr3ud.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.19615
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 758
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 53458
Cc: 53458 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Rudolf Schlatte <rudi@HIDDEN> writes:

> The OS changes the title bar color etc., but such a change would let
> Emacs adapt frame contents, for example by changing the active theme.

For Emacs to change the GTK stylesheet when the system tells it to over
the XDG portal API doesn't mean it will necessarily be possible for Lisp
programs to obtain the name of the stylesheet being utilized, but I
think something like what Carbon Emacs has would be a good idea.

I'm not convinced that implementing the former is a good idea, since
changing the decoration style should be (and will probably be in the
future) handled by either GTK+ or the window manager, while these
standards come and go, but I am not opposed to the latter.

Patches welcome, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53458; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Jan 2022 11:03:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 23 06:03:22 2022
Received: from localhost ([127.0.0.1]:38624 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBaeY-00058x-5q
	for submit <at> debbugs.gnu.org; Sun, 23 Jan 2022 06:03:22 -0500
Received: from lists.gnu.org ([209.51.188.17]:45046)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1nBaeX-00058q-3A
 for submit <at> debbugs.gnu.org; Sun, 23 Jan 2022 06:03:21 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50508)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1nBaeW-0001Pz-UM
 for bug-gnu-emacs@HIDDEN; Sun, 23 Jan 2022 06:03:20 -0500
Received: from ciao.gmane.io ([116.202.254.214]:49474)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1nBaeQ-0005se-U8
 for bug-gnu-emacs@HIDDEN; Sun, 23 Jan 2022 06:03:20 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1nBaeN-0004Nj-UT
 for bug-gnu-emacs@HIDDEN; Sun, 23 Jan 2022 12:03:11 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Rudolf Schlatte <rudi@HIDDEN>
Subject: Re: bug#53458: [Request,
 Linux] Follow system dark mode user preference
Date: Sun, 23 Jan 2022 12:02:44 +0100
Message-ID: <m18rv6k94b.fsf@HIDDEN>
References: <3iRhN5EFJnIdFLuFt_CnYryIAZSjHpoq96ZkkxYkI1DJS4cNYRyGd18E92AH1lTjuEY75njusiICZbdF_AD0brAkLZ_9o9Gk435hsZbXiho=@protonmail.com>
 <87wnirryve.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
Cancel-Lock: sha1:e4yHWem/29+1wkufjCCveX5aQVw=
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> Maximiliano Sandoval <msandova@HIDDEN> writes:
>
>> Recently a new setting was added to xdg-desktop-portal to declare the user
>> preference for a dark mode. This setting is DE-agnostic¹ and it is sandbox
>> friendly. The dark mode setting will be officially supported in GNOME 42,
>> elementary OS already supports it, and there is a merge request for KDE that
>> will most likely included its next release.
>>
>> How to implement
>
> Isn't the window manager and GTK+ responsible for this, and not the
> applications themselves?

The OS changes the title bar color etc., but such a change would let
Emacs adapt frame contents, for example by changing the active theme.
To give a concrete example, I have the snippet below in my init file,
evaluated when I'm running Yamamoto-san's Mac port:

  (add-hook 'mac-effective-appearance-change-hook
            #'(lambda () (pcase (plist-get (mac-application-state) :appearance)
                           ("NSAppearanceNameDarkAqua" (modus-themes-load-vivendi))
                           ("NSAppearanceNameAqua" (modus-themes-load-operandi))))) 







Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53458; Package emacs. Full text available.

Message received at 53458 <at> debbugs.gnu.org:


Received: (at 53458) by debbugs.gnu.org; 23 Jan 2022 02:04:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 22 21:04:52 2022
Received: from localhost ([127.0.0.1]:38282 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBSFQ-0005nC-Gz
	for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 21:04:52 -0500
Received: from sonic312-25.consmr.mail.ne1.yahoo.com ([66.163.191.206]:44650)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1nBSFO-0005mv-3Q
 for 53458 <at> debbugs.gnu.org; Sat, 22 Jan 2022 21:04:51 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1642903483; bh=4IIrc0OrZMl6snyuZib1h40Ng2RZCcDkFKxXK5S1+bk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=AgKvCWZcuFc9mt/idNeDNeBfkvu2S3eIjU2TqKOgToBEMU+wDbkCkNDz/FIDO44U09GUq3UTQrl83hmTD6epLW8fDcSWjbP+UhUeETbbeqDPafWkDL1zbJ7U5i28jKMNEYf75B/vTAoBJVOjbCH1LezEw1lnfcrjp02ias46yNXggUVpJCfmX9MegDYOiQMAg0mjePfhpl2jeZ37xxvfeVKbHTlsQM3fw8IpYl4F969FUhIs2zVKI2Ylnmp2hQBRYGnaIrGHU1VJhzLokG409ap32e0XjollH+WNw+7ldN5Vmd2pDjTW8VLWayQbwzZxWRvhm46gCd1+mt3Mw/V3JQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1642903483; bh=CB8M/E6I2ZgNEix42HdJAFS/fTuNSGlJfgDjwFhb2y7=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=SB8Gev/LpW6f8v0lBxuRfd252Lk/erEdlN6lAncaFS07vRacuB7ApI6xedUUroA3lZoUQEPkDtlNMqPaNrAA9fwxJyajnrOotO3HXYdjhgBLo+QxdA7FW8A87QDXoyU+yH5KXvbEtAM5VqzHyG1PV8H+ayHncMutdAIjnUVmqwI76iwonZuotfgcAMQaCVoCqfVOlzCiqOktDzpxom8J2/9LfHCxNneCSJfHSYMZ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H9apiHeX6BUIlrFxa_EkTCz4VdSMVEjRPzJT_vwSa8h.VRwUzYDyZY9NEgnuGypKIRqwo
 787D2Tg_aDAwDzsfGqrnn4eX4Oeu0.niJtS.Pnnvmtb6pdUlu2Zh8hbIY3VTrP2bK0heTRbKTYxz
 GOYWriGZq_U07s1dgQuMWhOat8liPq_cl6AceSQM_na8UFGNp.ymveOQQ5l2NsMMx2zH8Riq4JyF
 kaaUs5l13q_6nB6RtTL7y3SLToMyhkjk9TdrvBkWvQrX6TFqKeRfVKsWE5q7AexzolYt2Ke._mLP
 EVU8FmsGzca4FvsocQhlZZYiT64o_j_ZrUxtrCqm.RW5mBK9a41RDciuBiA--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sun, 23 Jan 2022 02:04:43 +0000
Received: by kubenode501.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP
 Server) with ESMTPA ID 9dbb8ad20ed5b281ff834f8c7bf3d734; 
 Sun, 23 Jan 2022 02:04:41 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Maximiliano Sandoval <msandova@HIDDEN>
Subject: Re: bug#53458: [Request, Linux] Follow system dark mode user
 preference
References: <3iRhN5EFJnIdFLuFt_CnYryIAZSjHpoq96ZkkxYkI1DJS4cNYRyGd18E92AH1lTjuEY75njusiICZbdF_AD0brAkLZ_9o9Gk435hsZbXiho=@protonmail.com>
Date: Sun, 23 Jan 2022 10:04:37 +0800
In-Reply-To: <3iRhN5EFJnIdFLuFt_CnYryIAZSjHpoq96ZkkxYkI1DJS4cNYRyGd18E92AH1lTjuEY75njusiICZbdF_AD0brAkLZ_9o9Gk435hsZbXiho=@protonmail.com>
 (Maximiliano Sandoval's message of "Sat, 22 Jan 2022 22:14:16 +0000")
Message-ID: <87wnirryve.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.19615
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 535
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 53458
Cc: 53458 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Maximiliano Sandoval <msandova@HIDDEN> writes:

> Recently a new setting was added to xdg-desktop-portal to declare the user
> preference for a dark mode. This setting is DE-agnostic=C2=B9 and it is s=
andbox
> friendly. The dark mode setting will be officially supported in GNOME 42,
> elementary OS already supports it, and there is a merge request for KDE t=
hat
> will most likely included its next release.
>
> How to implement

Isn't the window manager and GTK+ responsible for this, and not the
applications themselves?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53458; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 22:14:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 22 17:14:34 2022
Received: from localhost ([127.0.0.1]:38154 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nBOeX-00005M-Ov
	for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 17:14:34 -0500
Received: from lists.gnu.org ([209.51.188.17]:47184)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <msandova@HIDDEN>) id 1nBOeV-00005B-Ms
 for submit <at> debbugs.gnu.org; Sat, 22 Jan 2022 17:14:32 -0500
Received: from eggs.gnu.org ([209.51.188.92]:38696)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <msandova@HIDDEN>)
 id 1nBOeV-00065L-IQ
 for bug-gnu-emacs@HIDDEN; Sat, 22 Jan 2022 17:14:31 -0500
Received: from mail-0301.mail-europe.com ([188.165.51.139]:50435)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <msandova@HIDDEN>)
 id 1nBOeT-0008EI-GC
 for bug-gnu-emacs@HIDDEN; Sat, 22 Jan 2022 17:14:30 -0500
Date: Sat, 22 Jan 2022 22:14:16 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail2; t=1642889658;
 bh=jF3Oz4L47RRGZltdUYrpAZfrJOGO2JbYL77VKXFavu4=;
 h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc;
 b=Fq1XTon2HOwYnq8YOHNmKLImH9OpQRXSnm4mb6hHnzOuyEpZil3c2SQTrGqXrjSDq
 4cAo9MBJ0lVj+GCsIudVpkOflRr8j/mAu/ZugI/3CGiKCh5UdZ1aCg36edMX00FKk9
 sPtoDjXEkijSdazqDAZVbE37BmRFrxiSHGziFGPNDE3NBbHIJ/j0Eq2CxCw9Bs23db
 O6gfH+/94cTvjNN1pYc0Fpt/+SO39LcQmszC3qyZ4X6xsNBjIwd5PaJt0l7LibEpIK
 MvTtxYINMXs9FohNuxN+jm6ySyLOFjvqwfQt9779sMxBK0KRxEpnbWqkY9Pjq3k2/d
 SJYlQgk76aPsg==
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
From: Maximiliano Sandoval <msandova@HIDDEN>
Subject: [Request, Linux] Follow system dark mode user preference
Message-ID: <3iRhN5EFJnIdFLuFt_CnYryIAZSjHpoq96ZkkxYkI1DJS4cNYRyGd18E92AH1lTjuEY75njusiICZbdF_AD0brAkLZ_9o9Gk435hsZbXiho=@protonmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no
 autolearn=disabled version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 mailout.protonmail.ch
Received-SPF: pass client-ip=188.165.51.139;
 envelope-from=msandova@HIDDEN; helo=mail-0301.mail-europe.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,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Maximiliano Sandoval <msandova@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Recently a new setting was added to xdg-desktop-portal to declare the user
preference for a dark mode. This setting is DE-agnostic=C2=B9 and it is san=
dbox
friendly. The dark mode setting will be officially supported in GNOME 42,
elementary OS already supports it, and there is a merge request for KDE tha=
t
will most likely included its next release.

How to implement: Emacs has to read via dbus the value of the setting and l=
isten
for changes, then (if using a GtkHeaderBar) set the value of
GtkSetting:gtk-application-prefer-dark-theme so that the header bar/title b=
ar of
emacs follows the preference. Ideally there could be `color-scheme` variabl=
e for
which the user can set values

 * prefer-light
 * prefer-dark
 * follow-system

and a `is-dark-mode` variable so that users can read its value and add hook=
s to
it.

Note that desktops environments might add dark/light mode schedulers based =
on
the time of the day, so it is important to be able to set hooks and listen =
to
the dbus for changes of the setting.

Relevant devel discussions:

- https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01737.html
- https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00482.html

Relevant material:

- Freedesktop spec: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org=
.freedesktop.portal.Settings
- GNOME Dark mode initiative: https://gitlab.gnome.org/GNOME/Initiatives/-/=
issues/32
- C example (taken from the initiative): https://gitlab.gnome.org/GNOME/Ini=
tiatives/-/wikis/uploads/b590f6ee98c68b652d95708f707ce927/hello.c

--
Maximiliano




Acknowledgement sent to Maximiliano Sandoval <msandova@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#53458; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 7 Jun 2022 22:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.