From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47291: bug#51404: Support system dark mode on Windows 10 Date: Thu, 11 Nov 2021 09:51:16 +0200 Message-ID: <83wnlf166j.fsf@gnu.org> References: <834k93zxyo.fsf@gnu.org> <838ryfyawv.fsf@gnu.org> <83r1c5tyar.fsf@gnu.org> <83a6iqpzrv.fsf@gnu.org> <83k0huo1iy.fsf@gnu.org> <87wnlf8d9y.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16292"; mail-complaints-to="usenet@ciao.gmane.io" Cc: salvino@coderedcorp.com, 51404@debbugs.gnu.org, 47291@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 08:52:13 2021 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 1ml4sX-0003zd-41 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 08:52:13 +0100 Original-Received: from localhost ([::1]:41812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml4sV-0001yX-H2 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 02:52:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml4sM-0001uQ-GD for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 02:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ml4sM-0000ub-7L for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 02:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ml4sM-0000LF-5a for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 02:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47291 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47291-submit@debbugs.gnu.org id=B47291.16366170891261 (code B ref 47291); Thu, 11 Nov 2021 07:52:02 +0000 Original-Received: (at 47291) by debbugs.gnu.org; 11 Nov 2021 07:51:29 +0000 Original-Received: from localhost ([127.0.0.1]:40052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ml4ro-0000KF-Nt for submit@debbugs.gnu.org; Thu, 11 Nov 2021 02:51:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ml4rl-0000Jw-At; Thu, 11 Nov 2021 02:51:25 -0500 Original-Received: from [2001:470:142:3::e] (port=44676 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml4rf-0000lW-Pb; Thu, 11 Nov 2021 02:51:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gJyEuzZTmsxqRlWo3gN/CCJe1XXhDEBWJtg+Sn4tRYo=; b=meeiYWvGJ9z9 tLy06PmYvrnnqBSv6NoLkmUY8vo+7rLe+UjSxz4IOsNWBHvgYPoA5qKKgKOMZrhVE5U84uhiouQ0A ApxGNBqUvpZOSVB2U/6mWjSoJTWqGNvExKjh+etQoJO409w6ND7cIB/DwYRU8ocJyEM8Yi9dwXXUu Usss4ut7I6P03rdo6TEaYAsBXKhcWKcT0zyH7+K7MpK1CRy0hiqK6EkInOpiHnV2NumQRQ7n5no8b Kabmho6p0u8Gvfni5cXy+Yt2+/+FbHe92n8Wg4YgKmMsG+LtWL72YqgkxKsGA2y4L70A2vDK1I5X+ fyV8+CCqBWfxlKTTIyA4EQ==; Original-Received: from [87.69.77.57] (port=3193 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml4rf-0008OV-BL; Thu, 11 Nov 2021 02:51:19 -0500 In-Reply-To: <87wnlf8d9y.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 11 Nov 2021 06:36:09 +0100) 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:219610 Archived-At: > From: Lars Ingebrigtsen > Cc: Vince Salvino , 51404@debbugs.gnu.org, > 47291@debbugs.gnu.org > Date: Thu, 11 Nov 2021 06:36:09 +0100 > > Eli Zaretskii writes: > > > I'm not sure I understand why 'light' necessarily means the old > > behavior: we didn't set any theme before this change, we just used the > > Windows default. So maybe there should be 4 values: > > > > nil: never follow the system theme (use Windows default) > > t: always follow the system theme > > light: force light theme (currently the same as nil) > > dark: force dark theme. > > For a similar bug report, see bug#47291. And we really should support > this on GNU/Linux, too, so having three different methods to support > this seems sub-optimal. I'm not sure unification is possible here, because the functionality is quite different, AFAICT. At least for the functionality in this bug report, we cannot apply the system theme to an existing frame, we can only apply it at frame creation time. So having a handler for such changes will be able to affect only the frames created after the change. Or at least that is my understanding; the code definitely applies the dark/light theme as part of creating a frame. Also, having a dynamic thing that tracks changes in these settings would on Windows mean listening and processing a special window-system message, which seems to be WM_THEMECHANGED or maybe WM_SETTINGCHANGE. But that's not what the code installed in this bug report does. So the functionality seems similar, but the details differ.